commit 8b6d5ddf7966ff1b5ef95aee6b2454506f61a777
parent 9a2e697c43fbd2c2b73949e0c4bb47833285736a
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Thu, 17 Oct 2024 14:38:19 -0700
Only create or move points if pointer moves a bit
Otherwise you can just tap on the canvas and accidentally create
or move a point there.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js
@@ -984,7 +984,7 @@ function precisePointHandler(event, editor, state) {
init()
}
- state.origin = state.from.vec()
+ state.origin = cursor
} else if (event.type === "pointerup") {
if (state.from) {
cleanup()
@@ -992,7 +992,7 @@ function precisePointHandler(event, editor, state) {
return
}
} else if (event.type === "pointermove" && state.origin != undefined &&
- state.origin.distanceTo(cursor) > 200) {
+ state.origin.distanceTo(cursor) > params.threshold) {
state.to = editor.addPoint(cursor, true)
editor.mapPoints({ type: "wall", a: state.from, b: state.to})
state.to = editor.findObj(state.to)