commit a45a39450325398b1f2c48ddd29f2d134c3c355f
parent 2c3abb0b74ffe0c078e13a11d05273111ad44d76
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Fri, 13 Sep 2024 10:41:50 -0700
Center viewbox on 0,0 at startup
I want to significantly automate viewbox movement in the future,
but for now this'll be a nice tweak.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js
@@ -58,7 +58,9 @@ function init() {
}
})
editor.useUnits("imperial")
- editor.draw.viewbox(0, 0, editor.units.get("foot", 40), editor.units.get("foot", 40))
+ let s = editor.units.get("foot", 40)
+ let p = -s / 2
+ editor.draw.viewbox(p, p, s, s)
editor.draw.hide()
api.fetch("GET", "furniture")
.then(function(furniture) {