mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
fix: disable double-click on heightmap edit
This commit is contained in:
parent
b66874ddda
commit
ea27276558
6 changed files with 16 additions and 11 deletions
7
main.js
7
main.js
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue