LazMapViewer: Restrict zoom level to allowed range. Part of issue #39111.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9665 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
637f4bbf66
commit
d80d4c79f5
@ -939,9 +939,7 @@ begin
|
|||||||
Val := 1;
|
Val := 1;
|
||||||
if WheelDelta < 0 then
|
if WheelDelta < 0 then
|
||||||
Val := -1;
|
Val := -1;
|
||||||
nZoom := Zoom + Val;
|
nZoom := EnsureRange(Zoom + Val, FZoomMin, FZoomMax);
|
||||||
if (nZoom >= FZoomMin) and (nZoom <= FZoomMax) then
|
|
||||||
begin
|
|
||||||
if ZoomToCursor then
|
if ZoomToCursor then
|
||||||
begin
|
begin
|
||||||
MapWin.ZoomCenter := ScreenToLatLon(MousePos);
|
MapWin.ZoomCenter := ScreenToLatLon(MousePos);
|
||||||
@ -949,7 +947,6 @@ begin
|
|||||||
bZoomToCursor := True;
|
bZoomToCursor := True;
|
||||||
end;
|
end;
|
||||||
SetZoom(nZoom, bZoomToCursor);
|
SetZoom(nZoom, bZoomToCursor);
|
||||||
end;
|
|
||||||
Handled := true;
|
Handled := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1509,7 +1506,7 @@ begin
|
|||||||
tmpWin := MapWin;
|
tmpWin := MapWin;
|
||||||
tmpWin.Center.Lon := (aArea.TopLeft.Lon + aArea.BottomRight.Lon) / 2;
|
tmpWin.Center.Lon := (aArea.TopLeft.Lon + aArea.BottomRight.Lon) / 2;
|
||||||
tmpWin.Center.Lat := (aArea.TopLeft.Lat + aArea.BottomRight.Lat) / 2;
|
tmpWin.Center.Lat := (aArea.TopLeft.Lat + aArea.BottomRight.Lat) / 2;
|
||||||
tmpWin.Zoom := 18;
|
tmpWin.Zoom := FZoomMax;
|
||||||
TopLeft.X := 0;
|
TopLeft.X := 0;
|
||||||
TopLeft.Y := 0;
|
TopLeft.Y := 0;
|
||||||
BottomRight.X := tmpWin.Width;
|
BottomRight.X := tmpWin.Width;
|
||||||
|
Loading…
Reference in New Issue
Block a user