TAChart: Add workaround for issue #19780

git-svn-id: trunk@31813 -
This commit is contained in:
ask 2011-07-28 01:33:39 +00:00
parent 7e8b3df07f
commit 727c3782d1
2 changed files with 9 additions and 5 deletions

View File

@ -569,7 +569,9 @@ var
function TitleSize: Integer; function TitleSize: Integer;
begin begin
if not Title.Visible or (Title.Caption = '') then exit(0); if not Title.Visible or (Title.Caption = '') then exit(0);
Result := TPointBoolArr(Title.MeasureLabel(d, Title.Caption))[not v]; // Workaround for issue #19780, fix after upgrade to FPC 2.6.
with Title.MeasureLabel(d, Title.Caption) do
Result := IfThen(v, cx, cy);
if Title.DistanceToCenter then if Title.DistanceToCenter then
Result := Result div 2; Result := Result div 2;
Result += d.Scale(Title.Distance); Result += d.Scale(Title.Distance);
@ -579,8 +581,9 @@ var
var var
sz, fm, lm: Integer; sz, fm, lm: Integer;
begin begin
sz := TPointBoolArr( // Workaround for issue #19780, fix after upgrade to FPC 2.6.
Marks.MeasureLabel(d, FMarkValues[AIndex].FText))[v] div 2; with Marks.MeasureLabel(d, FMarkValues[AIndex].FText) do
sz := IfThen(v, cy, cx) div 2;
fm := sz - ACoord + ARMin; fm := sz - ACoord + ARMin;
lm := sz - ARMax + ACoord; lm := sz - ARMax + ACoord;
if v then if v then

View File

@ -530,8 +530,9 @@ begin
Result := 0; Result := 0;
if not Visible then exit; if not Visible then exit;
for t in AValues do for t in AValues do
Result := Max( // Workaround for issue #19780, fix after upgrade to FPC 2.6.
TPointBoolArr(MeasureLabel(ADrawer, t.FText))[AIsVertical], Result); with MeasureLabel(ADrawer, t.FText) do
Result := Max(IfThen(AIsVertical, cy, cx), Result);
if Result = 0 then exit; if Result = 0 then exit;
if DistanceToCenter then if DistanceToCenter then
Result := Result div 2; Result := Result div 2;