From 239af4fb8267f8933454d75090f84dbd2ccb675a Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 29 Oct 2025 09:03:19 +0100 Subject: [PATCH] :bug: Fix problem with text grow types --- .../src/app/main/data/workspace/transforms.cljs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index bf8597a11d..12bec8ca59 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -382,7 +382,19 @@ get-modifier (fn [shape] - (ctm/change-dimensions-modifiers shape attr value)) + (let [modifiers (ctm/change-dimensions-modifiers shape attr value)] + ;; For text shapes, also update grow-type based on the resize + (if (cfh/text-shape? shape) + (let [{sr-width :width sr-height :height} (:selrect shape) + new-width (if (= attr :width) value sr-width) + new-height (if (= attr :height) value sr-height) + scalev (gpt/point (/ new-width sr-width) (/ new-height sr-height)) + current-grow-type (dm/get-prop shape :grow-type) + new-grow-type (dwm/next-grow-type current-grow-type scalev)] + (cond-> modifiers + (not= new-grow-type current-grow-type) + (ctm/change-property :grow-type new-grow-type))) + modifiers))) modif-tree (-> (dwm/build-modif-tree ids objects get-modifier)