mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 20:12:36 +02:00
TAChart: More user-friendly zoom-in by ZoomDragTool with fixed RatioLimit
This commit is contained in:
parent
6dd342cef1
commit
345460427e
@ -1304,6 +1304,7 @@ var
|
||||
ScaleX, ScaleY: Double;
|
||||
AllowProportionalAdjustmentX, AllowProportionalAdjustmentY: Boolean;
|
||||
begin
|
||||
// Allow user to adjust the calculated new extent
|
||||
DoCalculateNewExtent(ANewExtent);
|
||||
|
||||
if not AFull then
|
||||
@ -1511,6 +1512,7 @@ const
|
||||
(zreDragTopLeft, zreClick, zreDragBottomLeft),
|
||||
(zreClick, zreClick, zreClick),
|
||||
(zreDragTopRight, zreClick, zreDragBottomRight));
|
||||
// Means: "direction relative to mouse-down point"
|
||||
var
|
||||
dragDir: TRestoreExtentOn;
|
||||
begin
|
||||
@ -1522,6 +1524,18 @@ begin
|
||||
|
||||
with FSelectionRect do
|
||||
dragDir := DRAG_DIR[Sign(Right - Left), Sign(Bottom - Top)];
|
||||
|
||||
// More user-friendly drag direction for zoom-in in case of fixed RatioLimit
|
||||
case RatioLimit of
|
||||
zrlNone, zrlProportional: ;
|
||||
zrlFixedX:
|
||||
// drag down (not necessarily right)
|
||||
if dragDir = zreDragBottomLeft then dragdir := zreDragBottomRight;
|
||||
zrlFixedY:
|
||||
// drag right (not necessarily down)
|
||||
if dragDir = zreDragTopRight then dragdir := zreDragBottomRight;
|
||||
end;
|
||||
|
||||
if
|
||||
(dragDir in RestoreExtentOn) or
|
||||
(zreDifferentDrag in RestoreExtentOn) and
|
||||
|
Loading…
Reference in New Issue
Block a user