www.spaceplanner.app

Web client to the spaceplanner API
git clone git://jacobedwards.org/www.spaceplanner.app
Log | Files | Refs

commit 0375b309d1d308ab6dabc119e04232cdedc1931a
parent f773af1b8acd152ed4fe20e8cc43ff4017d81992
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Thu, 17 Oct 2024 11:38:41 -0700

Handle pointercancel events pointer handlers

This is good to handle regardless, but I'm mostly adding it for
some future changes.

Diffstat:
Mfiles/floorplans/floorplan/main.js | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -854,7 +854,7 @@ function precisePointHandler(event, editor, state) { cleanup() } - if (State.panZoom) { + if (State.panZoom || event.type === "pointercancel") { if (state.to) { revert() } @@ -963,6 +963,11 @@ function precisePointMapHandler(event, editor, state) { } } + if (event.type === "pointercancel") { + cleanup() + return + } + let cursor = editor.draw.point(event.clientX, event.clientY).vec() if (editor.thingAt(cursor, "#points")) { return @@ -1054,7 +1059,7 @@ function furnitureHandler(ev, editor, state) { } } - if (state.panZoom) { + if (state.panZoom || ev.type === "pointercancel") { cleanup() return }