Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 875

Summary: Multi-line node text not correctly displayed
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: TTreeAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement CC: buhl
Priority: ---    
Version: 140512   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?f=5&t=15067
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2014-08-04 08:01:18 EDT
Multi-line node text not correctly displayed, if the line count is even.
Code to reproduce:

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;

Fix suggested by the customer:
At line 4164 in TeeTree.pas, function TTreeNodeShape.DrawText reads:

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

Change the above for this to fix the problem:

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