fix: disable double-click on heightmap edit

This commit is contained in:
Azgaar 2024-09-22 20:07:55 +02:00 committed by sofronaspe
parent 342ee80258
commit 10a7e4599c
6 changed files with 16 additions and 11 deletions

View file

@ -171,7 +171,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);
@ -183,9 +183,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 = {