y
This commit is contained in:
parent
61718e2981
commit
f657b6a4a4
94 changed files with 3970 additions and 1241 deletions
|
|
@ -533,6 +533,7 @@
|
|||
|
||||
function beginPan(clientX, clientY, button = null) {
|
||||
uiCache.panning = true;
|
||||
if (button === 2) uiCache.suppressContextMenuUntil = 0;
|
||||
uiCache.panMoved = false;
|
||||
uiCache.panButton = button;
|
||||
uiCache.panStartX = clientX;
|
||||
|
|
@ -560,8 +561,11 @@
|
|||
function endPan(button = null) {
|
||||
if (!uiCache.panning) return false;
|
||||
if (uiCache.panButton !== null && button !== null && button !== uiCache.panButton) return false;
|
||||
const endedButton = uiCache.panButton;
|
||||
const moved = Boolean(uiCache.panMoved);
|
||||
uiCache.panning = false;
|
||||
uiCache.panButton = null;
|
||||
if (endedButton === 2 && moved) uiCache.suppressContextMenuUntil = (performance?.now?.() ?? Date.now()) + 650;
|
||||
canvas.style.cursor = cursorForTool(world.tool);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue