Skip to content

Commit

Permalink
Fix: min zoom extent is allowed to be negative. (#860)
Browse files Browse the repository at this point in the history
* Fix: min zoom extent is allowed to be negative.
Min and Max Zoom fields are now bound by 0.01 and 200

* Fixed comparison

* Version bump

* Hash set in index.html
  • Loading branch information
StempunkDev authored Aug 25, 2022
1 parent bfba711 commit 409681d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7817,7 +7817,7 @@
<script src="modules/ui/stylePresets.js"></script>

<script src="modules/ui/general.js?v=1.87.00"></script>
<script src="modules/ui/options.js?v=1.87.00"></script>
<script src="modules/ui/options.js?v=1.87.09"></script>
<script src="main.js"></script>

<script defer src="modules/relief-icons.js"></script>
Expand Down
5 changes: 5 additions & 0 deletions modules/ui/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,13 @@ function changeDialogsTheme(themeColor, transparency) {
}

function changeZoomExtent(value) {
if(+zoomExtentMin.value > +zoomExtentMax.value) {
[zoomExtentMin.value, zoomExtentMax.value]=[zoomExtentMax.value, zoomExtentMin.value];
}
const min = Math.max(+zoomExtentMin.value, 0.01);
const max = Math.min(+zoomExtentMax.value, 200);
zoomExtentMin.value = min;
zoomExtentMax.value = max;
zoom.scaleExtent([min, max]);
const scale = minmax(+value, 0.01, 200);
zoom.scaleTo(svg, scale);
Expand Down
2 changes: 1 addition & 1 deletion versioning.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

// version and caching control
const version = "1.87.08"; // generator version, update each time
const version = "1.87.09"; // generator version, update each time

{
document.title += " v" + version;
Expand Down

0 comments on commit 409681d

Please sign in to comment.