TAChart: Fix incorrect scaling of TScaledCanvasDrawer

git-svn-id: branches/fixes_2_0@60280 -
This commit is contained in:
mattias 2019-02-02 18:39:54 +00:00
parent 239b73fdac
commit 4b5c1dcce3
2 changed files with 4 additions and 3 deletions

View File

@ -1788,6 +1788,7 @@ var
dir: TLabelDirection;
m: array [TLabelDirection] of Integer absolute AMargins;
gp: TDoublePoint;
scMarksDistance: Integer;
begin
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
if Count = 0 then exit;
@ -1805,6 +1806,7 @@ begin
Count-1}
FindExtentInterval(ParentChart.CurrentExtent, Source.IsSorted);
scMarksDistance := ADrawer.Scale(Marks.Distance);
for i := FLoBound to FUpBound do begin
gp := GetGraphPoint(i);
if not ParentChart.IsPointInViewPort(gp) then continue;
@ -1817,7 +1819,7 @@ begin
if Marks.DistanceToCenter then
dist := dist div 2;
m[dir] := Max(m[dir], dist + Marks.Distance);
m[dir] := Max(m[dir], dist + scMarksDistance);
end;
end;

View File

@ -599,7 +599,6 @@ begin
(AMargin.Top <> AChartMargins.Top) or (AMargin.Bottom <> AChartMargins.Bottom),
true, @FCurrentExtent.a.Y, @FCurrentExtent.b.Y);
FScale.X := rX.CalcScale(1);
FScale.Y := rY.CalcScale(-1);
if Proportional then begin
@ -1251,7 +1250,7 @@ begin
if s.Active then
s.UpdateMargins(ADrawer, Result);
for i := Low(a) to High(a) do
a[i] := ADrawer.Scale(a[i] + TRectArray(Margins.Data)[i]);
a[i] := a[i] + ADrawer.Scale(TRectArray(Margins.Data)[i]);
end;
function TChart.GetRenderingParams: TChartRenderingParams;