TCustomTeeGradient.DrawRadial

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Alessandro
Newbie
Newbie
Posts: 9
Joined: Fri Jan 20, 2006 12:00 am

TCustomTeeGradient.DrawRadial

Post by Alessandro » Tue May 23, 2006 12:23 pm

Hi,
I have found a bug in TCustomTeeGradient.DrawRadial (v.7.07), line 6441,6442 in TeCanvas.pas:

Step:=Math.Min(255,Math.Max(SizeX,SizeY));
InvStep:=1/Step;

if you pass an empty TRect to the procedure Step = 0 and division by 0 is raised.

Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 23, 2006 12:54 pm

Hi Alessandro,

Could you please send us an example we can run "as-is" or the steps we should follow to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Alessandro
Newbie
Newbie
Posts: 9
Joined: Fri Jan 20, 2006 12:00 am

Post by Alessandro » Tue May 23, 2006 1:05 pm

Hi Narcis, in my project I return an empty rect in OnGetLegendRect event.
If the gradient style of the legend is radial the error occurs. You shoud test that the rect passed to the procedure is not empty. You can easily find the potential error in the source of TeCanvas.

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 23, 2006 1:33 pm

Hi Alessandro,

I'm unable to reproduce the problem here using this code:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues();
  Chart1.Legend.Gradient.Direction:=gdRadial;
end;

procedure TForm1.Chart1GetLegendRect(Sender: TCustomChart;
  var Rect: TRect);
begin
  Chart1.Title.Text[0]:=IntToStr(Rect.Left)+', '+
                        IntToStr(Rect.Top)+', '+
                        IntToStr(Rect.Right)+', '+
                        IntToStr(Rect.Bottom);
end;
Can you please modify it or send us an example so that we can reproduce the problem here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply