commit eb84d9b72dbcf451aa05b7c4450409e130174203 parent 6c62a16d562bc487e7cdfc9357022e8f0a4457ec Author: Jacob R. Edwards <jacob@jacobedwards.org> Date: Wed, 9 Oct 2024 19:48:37 -0700 Show selected pointmap's length At some point I want to have pretty graphics you can toggle on to display this information, but this is a quick and dirty solution. Diffstat:
| M | files/floorplans/floorplan/main.js | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -255,6 +255,17 @@ function selectHandler(event, editor, state) { ) } + if (state.maplength) { + state.maplength.remove() + delete state.maplength + } + if (groups.pntmap && cnt === 1) { + state.maplength = document.body.querySelector(".toolbar") + .appendChild(document.createElement("li")) + state.maplength.appendChild(document.createTextNode("Length: " + + userLength(editor, editor.pointmapLength(groups.pntmap[0])))) + } + let maps = [] if (groups.pntmap !== undefined) { for (let i = 0; i < groups.pntmap.length; ++i) {