From 727c3782d15a62cf92867a8da8b9a5301b8ea4a7 Mon Sep 17 00:00:00 2001 From: ask Date: Thu, 28 Jul 2011 01:33:39 +0000 Subject: [PATCH] TAChart: Add workaround for issue #19780 git-svn-id: trunk@31813 - --- components/tachart/tachartaxis.pas | 9 ++++++--- components/tachart/tachartaxisutils.pas | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/tachart/tachartaxis.pas b/components/tachart/tachartaxis.pas index b6903fa73d..4914c309b6 100644 --- a/components/tachart/tachartaxis.pas +++ b/components/tachart/tachartaxis.pas @@ -569,7 +569,9 @@ var function TitleSize: Integer; begin 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 Result := Result div 2; Result += d.Scale(Title.Distance); @@ -579,8 +581,9 @@ var var sz, fm, lm: Integer; begin - sz := TPointBoolArr( - Marks.MeasureLabel(d, FMarkValues[AIndex].FText))[v] div 2; + // Workaround for issue #19780, fix after upgrade to FPC 2.6. + with Marks.MeasureLabel(d, FMarkValues[AIndex].FText) do + sz := IfThen(v, cy, cx) div 2; fm := sz - ACoord + ARMin; lm := sz - ARMax + ACoord; if v then diff --git a/components/tachart/tachartaxisutils.pas b/components/tachart/tachartaxisutils.pas index fb43f5a4f1..51ebfcd500 100644 --- a/components/tachart/tachartaxisutils.pas +++ b/components/tachart/tachartaxisutils.pas @@ -530,8 +530,9 @@ begin Result := 0; if not Visible then exit; for t in AValues do - Result := Max( - TPointBoolArr(MeasureLabel(ADrawer, t.FText))[AIsVertical], Result); + // Workaround for issue #19780, fix after upgrade to FPC 2.6. + with MeasureLabel(ADrawer, t.FText) do + Result := Max(IfThen(AIsVertical, cy, cx), Result); if Result = 0 then exit; if DistanceToCenter then Result := Result div 2;