www.spaceplanner.app

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

commit 815504354ba6a10877f0099e6ac973bd5b516154
parent 48cc1a0e2ae6ade542f84d3b8af96d02972b620e
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Mon, 19 Aug 2024 09:48:52 -0700

Stop wall adding process if the user releases the button on the origin

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

diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -297,8 +297,12 @@ function preciseAddWallHandler(event, editor, state) { p = snap(editor.units.snapTo(p, editor.unit), sp, 8) updatePoint(p) } else if (event.type === "mouseup") { - state.moving = false - state.lastmoving = Date.now() + if (state.from.inside(p.x, p.y)) { + cleanup(); + } else { + state.moving = false + state.lastmoving = Date.now() + } } else if (event.type === "keydown") { if (event.key === "Enter") { addWall()