www.spaceplanner.app

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

commit 2f3db1aae58a97c25485bf973fb1beb8fbc67d8e
parent ce20e409b3dd48406fce2785b9d125d8764120b3
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Thu,  3 Oct 2024 12:45:45 -0700

Fix setting door swing with certain angles

When point a was below point b, the door swing direction would be
opposite of what it should've been. This fixes that.

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

diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -719,10 +719,17 @@ function precisePointMapHandler(event, editor, state) { cleanup() return } + let o = door.point_offset(cursor) if (state.hinge === "b") { o = -o } + + let v = door.vecs() + if (v[0].y < v[1].y) { + o = -o + } + let s = (o > 0 ? "+" : "-") editor.backend.mapPoints(state.door.type, state.door.a, state.door.b, { door_swing: state.hinge + s }) cleanup()