commit 215f475e31be0c8e9e571418fe7d05519ffb7bbc parent b8444cbe4632897ce848e23ebb8fec04333a09f4 Author: Jacob R. Edwards <jacob@jacobedwards.org> Date: Sun, 25 Aug 2024 14:06:10 -0700 Add force flag to editor's addPoint method This allows you to force creation of a new point instead of returning an existing one if it would be inside the new point's origin. Diffstat:
| M | files/floorplans/floorplan/editor.js | | | 10 | ++++++---- |
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/files/floorplans/floorplan/editor.js b/files/floorplans/floorplan/editor.js @@ -373,10 +373,12 @@ export class FloorplanEditor { this.updateDisplay() } - addPoint(point) { - let already = this.pointAt(point) - if (already) { - return already.select() + addPoint(point, force) { + if (!force) { + let already = this.pointAt(point) + if (already) { + return already + } } this.backend.addPoint(point) this.updateDisplay()