mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 04:29:28 +02:00
Merged revision(s) 51585 #2ee5aeec56 from trunk:
TAChart: Fix mouse-wheel-zooming with fixed chart center. ........ git-svn-id: branches/fixes_1_6@51611 -
This commit is contained in:
parent
83e7ffa28b
commit
26e14895f4
@ -1334,12 +1334,14 @@ var
|
|||||||
ext: TDoubleRect;
|
ext: TDoubleRect;
|
||||||
begin
|
begin
|
||||||
ext := FChart.LogicalExtent;
|
ext := FChart.LogicalExtent;
|
||||||
center := FChart.ImageToGraph(APoint);
|
|
||||||
sz := ext.b - ext.a;
|
sz := ext.b - ext.a;
|
||||||
if FixedPoint and (sz.X <> 0) and (sz.Y <> 0) then
|
if FixedPoint and (sz.X <> 0) and (sz.Y <> 0) then begin
|
||||||
ratio := (center - ext.a) / sz
|
center := FChart.ImageToGraph(APoint);
|
||||||
else
|
ratio := (center - ext.a) / sz;
|
||||||
|
end else begin
|
||||||
|
center := DoublePoint((ext.a.x + ext.b.X) / 2, (ext.a.y + ext.b.y) / 2);
|
||||||
ratio := DoublePoint(0.5, 0.5);
|
ratio := DoublePoint(0.5, 0.5);
|
||||||
|
end;
|
||||||
ext.a := center - sz * ratio / AFactor;
|
ext.a := center - sz * ratio / AFactor;
|
||||||
ext.b := center + sz * (DoublePoint(1, 1) - ratio) / AFactor;
|
ext.b := center + sz * (DoublePoint(1, 1) - ratio) / AFactor;
|
||||||
DoZoom(ext, false);
|
DoZoom(ext, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user