From 02502bf4e9f32ff671851e2d28aaccaeb4ca7bbd Mon Sep 17 00:00:00 2001 From: Luca Conte Date: Mon, 17 Feb 2025 15:06:43 +0100 Subject: [PATCH] fix the zoom --- controllers/draw-controller.js | 2 +- style.css | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/controllers/draw-controller.js b/controllers/draw-controller.js index 2e51545..54fab50 100644 --- a/controllers/draw-controller.js +++ b/controllers/draw-controller.js @@ -15,7 +15,7 @@ function draw() { // draw connections c.strokeStyle = "white"; - c.lineWidth = 3; + c.lineWidth = 3 * Camera.zoom; for (let box of Box.instances) { for (let input of box.inputs) { diff --git a/style.css b/style.css index 30e1377..ce30dfa 100644 --- a/style.css +++ b/style.css @@ -50,8 +50,9 @@ body { width: 100%; height: 100%; overflow: none; - zoom: var(--zoom); - font-size: calc(1em * var(--zoom)); + transform: scale(var(--zoom)); + transform-origin: top left; +/* font-size: calc(1em * var(--zoom));*/ } @@ -132,6 +133,15 @@ textarea { min-width: 200px; } +/*#playground input, +#playground textarea, +#playground select, +#playground button, +#playground .connectorLabel, +#playground .boxTitle { + scale: var(--zoom); +}*/ + .boxConnectorContainer { display: flex; flex-direction: row;