commit cf9ff5252f06e45d1e36a051b4e986e2515314bf
parent 384a1a15a87219078f8e640b7aa87d0b182394b6
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Mon, 14 Oct 2024 19:38:14 -0700
Fix ridiculusly erronous fix from 63e58d2
I wanted to ensure that no point could be mapped to itself and
instead made it that addPoint couldn't be called with the same value
for the x and y coordinates.
Now we actually do what we're suppost to.
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/files/floorplans/floorplan/backend.js b/files/floorplans/floorplan/backend.js
@@ -470,9 +470,6 @@ export class FloorplanBackend {
parse: parseInt
}
})
- if (params.x === params.y) {
- throw new Error(`${params.x}:${params.y}: Cannot map a point to itself`)
- }
return this.addData(id ?? "points", p)
}
@@ -535,7 +532,9 @@ export class FloorplanBackend {
}
}
})
-
+ if (m.a === m.b) {
+ throw new Error(`${m.a}:${m.b}: Cannot map a point to itself`)
+ }
this.addData(this.whichPointMap(m.a, m.b) ?? "pointmaps", m)
}