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 - Multi-line node text not correctly displayed
Summary: Multi-line node text not correctly displayed
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: TTree (show other bugs)
Version: 140512
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-04 08:01 EDT by yeray alonso
Modified: 2014-09-02 01:11 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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) );