Multi-line node text not correctly displayed

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Collinor
Newbie
Newbie
Posts: 12
Joined: Wed Oct 16, 2013 12:00 am

Multi-line node text not correctly displayed

Post by Collinor » Mon Jul 14, 2014 11:19 am

In the TTree component of TeeChart 2014 of May 12, 2014, multi-line node text not correctly displayed, if the line count is even.
Therefore line 4164 in TeeTree.pas, function TTreeNodeShape.DrawText

Code: Select all

vtaCenter: tmpPosY:=tmpMidY + Round( (t*tmpH) - ((tmpCount div 2)*tmpH) - (tmpH*0.5) );
has to be fixed as follows:

Code: Select all

vtaCenter: tmpPosY:=tmpMidY + Round( (t*tmpH) - ((tmpCount div 2)*tmpH) - (tmpCount mod 2)*(tmpH*0.5) );

Yeray
Site Admin
Site Admin
Posts: 8704
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Multi-line node text not correctly displayed

Post by Yeray » Tue Jul 15, 2014 2:17 pm

Hello,

I can't reproduce the problem here with the following code:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  TreeNodeShape1.Text.Clear;
  for i:=0 to 10 do
   TreeNodeShape1.Text.Add('Line ' + IntToStr(i));
end;
What have I incorrectly understood?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Collinor
Newbie
Newbie
Posts: 12
Joined: Wed Oct 16, 2013 12:00 am

Re: Multi-line node text not correctly displayed

Post by Collinor » Thu Jul 24, 2014 5:42 am

You added an odd number of lines (0 to 10) to the shape. The following code reproduces the problem:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  TreeNodeShape1.Text.Clear;
  for i:=1 to 10 do
   TreeNodeShape1.Text.Add('Line ' + IntToStr(i));
end;

Yeray
Site Admin
Site Admin
Posts: 8704
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Multi-line node text not correctly displayed

Post by Yeray » Mon Aug 04, 2014 12:04 pm

Hello,

Sorry for the confusion. I could reproduce the problem (so I added it to the public tracker B875) and also checked your suggestion fixes it, so I've implemented the change and the next maintenance release will include it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply