www.spaceplanner.app

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

commit 5a15515e01664537615f594809fecab2d7827fb1
parent 413a37b269e644e1586a5c6147c938c46db9716d
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Mon, 23 Sep 2024 11:19:38 -0700

Fix precisePointHandler snapmap removal

We only want to remove the snapmap if it didn't already exist, but
before it was removed no matter what causing unpleasent behavior.

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

diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -463,10 +463,18 @@ function precisePointHandler(event, editor, state) { editor.remove(state.snapmap) } state.to = editor.findObj(instead) + if (state.removeSnapmap == undefined) { + state.removeSnapmap = editor.backend.whichPointMap( + lib.getID(state.from), lib.getID(state.to) + ) == null + } state.snapmap = editor.mapPoints("wall", state.from, state.to) } } else if (state.snapmap != null) { - editor.remove(state.snapmap) + if (state.removeSnapmap) { + editor.remove(state.snapmap) + delete state.removeSnapmap + } state.snapmap = null state.to = editor.addPoint(p, true) editor.mapPoints("wall", state.from, state.to)