Fix: min zoom extent is allowed to be negative. (#860)

* 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
This commit is contained in:
Leo 2022-08-25 18:16:02 +02:00 committed by GitHub
parent bfba711d8b
commit 409681d89d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -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);