fix: disable double-click on heightmap edit

This commit is contained in:
Azgaar 2024-09-22 20:07:55 +02:00
parent b66874ddda
commit ea27276558
6 changed files with 16 additions and 11 deletions

View file

@ -170,7 +170,7 @@ let scale = 1;
let viewX = 0;
let viewY = 0;
function onZoom() {
const onZoom = debounce(function () {
const {k, x, y} = d3.event.transform;
const isScaleChanged = Boolean(scale - k);
@ -182,9 +182,8 @@ function onZoom() {
viewY = y;
handleZoom(isScaleChanged, isPositionChanged);
}
const onZoomDebouced = debounce(onZoom, 50);
const zoom = d3.zoom().scaleExtent([1, 20]).on("zoom", onZoomDebouced);
}, 50);
const zoom = d3.zoom().scaleExtent([1, 20]).on("zoom", onZoom);
// default options, based on Earth data
let options = {