From a11b0f54d7bb94d4afcfa302f687022a4dfe8255 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 7 Nov 2025 11:52:53 +0100 Subject: [PATCH] :bug: Fix changing properties resizes the text box height --- frontend/src/app/main/data/workspace/texts.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 6fca2a7a63..be12360bd9 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -56,16 +56,19 @@ ([shape] (resize-wasm-text-modifiers shape (:content shape))) - ([{:keys [id points selrect] :as shape} content] + ([{:keys [id points selrect grow-type] :as shape} content] (wasm.api/use-shape id) (wasm.api/set-shape-text-content id content) (wasm.api/set-shape-text-images id content) (let [dimension (wasm.api/get-text-dimensions) - resize-v (gpt/point - (/ (:width dimension) (-> selrect :width)) - (/ (:height dimension) (-> selrect :height))) - + width-scale (if (#{:fixed :auto-height} grow-type) + 1.0 + (/ (:width dimension) (:width selrect))) + height-scale (if (= :fixed grow-type) + 1.0 + (/ (:height dimension) (:height selrect))) + resize-v (gpt/point width-scale height-scale) origin (first points)] {id