mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 18:39:09 +02:00
TAChart: Fix incorrect scaling of TScaledCanvasDrawer (https://forum.lazarus.freepascal.org/index.php/topic,44041.msg309209.html)
git-svn-id: trunk@60225 -
This commit is contained in:
parent
14ebc45053
commit
087ce17ca3
@ -1788,6 +1788,7 @@ var
|
|||||||
dir: TLabelDirection;
|
dir: TLabelDirection;
|
||||||
m: array [TLabelDirection] of Integer absolute AMargins;
|
m: array [TLabelDirection] of Integer absolute AMargins;
|
||||||
gp: TDoublePoint;
|
gp: TDoublePoint;
|
||||||
|
scMarksDistance: Integer;
|
||||||
begin
|
begin
|
||||||
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
|
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
|
||||||
if Count = 0 then exit;
|
if Count = 0 then exit;
|
||||||
@ -1805,6 +1806,7 @@ begin
|
|||||||
Count-1}
|
Count-1}
|
||||||
FindExtentInterval(ParentChart.CurrentExtent, Source.IsSorted);
|
FindExtentInterval(ParentChart.CurrentExtent, Source.IsSorted);
|
||||||
|
|
||||||
|
scMarksDistance := ADrawer.Scale(Marks.Distance);
|
||||||
for i := FLoBound to FUpBound do begin
|
for i := FLoBound to FUpBound do begin
|
||||||
gp := GetGraphPoint(i);
|
gp := GetGraphPoint(i);
|
||||||
if not ParentChart.IsPointInViewPort(gp) then continue;
|
if not ParentChart.IsPointInViewPort(gp) then continue;
|
||||||
@ -1817,7 +1819,7 @@ begin
|
|||||||
if Marks.DistanceToCenter then
|
if Marks.DistanceToCenter then
|
||||||
dist := dist div 2;
|
dist := dist div 2;
|
||||||
|
|
||||||
m[dir] := Max(m[dir], dist + Marks.Distance);
|
m[dir] := Max(m[dir], dist + scMarksDistance);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -602,7 +602,6 @@ begin
|
|||||||
(AMargin.Top <> AChartMargins.Top) or (AMargin.Bottom <> AChartMargins.Bottom),
|
(AMargin.Top <> AChartMargins.Top) or (AMargin.Bottom <> AChartMargins.Bottom),
|
||||||
true, @FCurrentExtent.a.Y, @FCurrentExtent.b.Y);
|
true, @FCurrentExtent.a.Y, @FCurrentExtent.b.Y);
|
||||||
|
|
||||||
|
|
||||||
FScale.X := rX.CalcScale(1);
|
FScale.X := rX.CalcScale(1);
|
||||||
FScale.Y := rY.CalcScale(-1);
|
FScale.Y := rY.CalcScale(-1);
|
||||||
if Proportional then begin
|
if Proportional then begin
|
||||||
@ -1255,7 +1254,7 @@ begin
|
|||||||
if s.Active then
|
if s.Active then
|
||||||
s.UpdateMargins(ADrawer, Result);
|
s.UpdateMargins(ADrawer, Result);
|
||||||
for i := Low(a) to High(a) do
|
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;
|
end;
|
||||||
|
|
||||||
function TChart.GetRenderingParams: TChartRenderingParams;
|
function TChart.GetRenderingParams: TChartRenderingParams;
|
||||||
|
Loading…
Reference in New Issue
Block a user