www.spaceplanner.app

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

commit a2b7b2ec8473d5c295e6811a8f1c2b22b116c35e
parent 3ac1ebe52748b1f0a882237ab979cab11291e1c2
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Sun, 14 Sep 2025 18:33:59 -0500

Add furniture angle snapping toggle

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

diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -66,7 +66,8 @@ let State = { pointOp: 'Create', snapAngle: true, snapPoints: true, - lastClick: null + lastClick: null, + furnRotationSnap: true } const debug = (new URLSearchParams(new URL(document.URL).search)).get("debug") != undefined @@ -242,6 +243,12 @@ function run(editor) { on: function() { State.snapPoints = true }, value: State.snapPoints }))) + tg.append(item(checkToggle("Furniture angle snap", { + title: "Snap furniture rotation at 45 degree angles", + off: function() { State.furnRotationSnap = false }, + on: function() { State.furnRotationSnap = true }, + value: State.furnRotationSnap + }))) toolbar.append(undoRedo) toolbar.append(item(addFurn)) @@ -1448,9 +1455,11 @@ function furnitureParamsMenu(editor, id) { let a if (ev.target.value.length === 0) { a = 0 + } else if (!State.furnRotationSnap) { + a = ev.target.value } else { const snapOn = 45 - const snapAt = 6 + const snapAt = 15 a = ev.target.value let d = (a % snapOn) if (d < snapAt) {