commit 2e8a3d20263520914eac7e46edf27517b6d04558
parent 7e7dfe3627f55eb02304a6117924f73e5634dd2d
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Mon, 23 Sep 2024 10:24:27 -0700
Allow setting door swing on pointmaps in backend
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/files/floorplans/floorplan/backend.js b/files/floorplans/floorplan/backend.js
@@ -501,11 +501,21 @@ export class FloorplanBackend {
throw new Error(`${a}, ${b}: Pointmap must reference existing points`)
}
- return this.addData(this.whichPointMap(a, b) ?? "pointmaps", {
+ let d = {
type: type,
a: a,
b: b
- }, options)
+ }
+ if (options.door_swing != null) {
+ switch (options.door_swing) {
+ case "a+": case "a-": case "b+": case "b-":
+ break;
+ default:
+ throw new Error(options.door_swing + ": Invalid door swing")
+ }
+ d.door_swing = options.door_swing
+ }
+ return this.addData(this.whichPointMap(a, b) ?? "pointmaps", d, options)
}
unmapPoints(id, options) {