Skip to content

Commit

Permalink
Fixed crash when scrolled maps too much (fix #529)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Feb 28, 2024
1 parent 72dfaee commit e7f357d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions projects/GKMap/GKMap.Core/MapCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,17 @@ public int Zoom
}
set {
if (fZoom != value && !IsDragging) {
int newZoom;
if (value > MaxZoom) {
fZoom = MaxZoom;
newZoom = MaxZoom;
} else if (value < MinZoom) {
fZoom = MinZoom;
newZoom = MinZoom;
} else {
fZoom = value;
newZoom = value;
}
if (fZoom == newZoom) return;

fZoom = newZoom;

fMinOfTiles = fProvider.Projection.GetTileMatrixMinXY(value);
fMaxOfTiles = fProvider.Projection.GetTileMatrixMaxXY(value);
Expand Down

0 comments on commit e7f357d

Please sign in to comment.