From bcbbbd0d5d776acf9bcb63fc150f6f1c8fc1b188 Mon Sep 17 00:00:00 2001 From: Elena Torro Date: Mon, 1 Dec 2025 18:12:19 +0100 Subject: [PATCH] :bug: Fix create empty text on click regression --- .../src/app/main/ui/workspace/shapes/text/v2_editor.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs b/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs index e182eaabab..a8086e2bdb 100644 --- a/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/text/v2_editor.cljs @@ -320,10 +320,12 @@ [{:keys [x y width height]} transform] (if render-wasm? - (let [{:keys [height]} (wasm.api/get-text-dimensions shape-id) + (let [{:keys [width height]} (wasm.api/get-text-dimensions shape-id) selrect-transform (mf/deref refs/workspace-selrect) [selrect transform] (dsh/get-selrect selrect-transform shape) selrect-height (:height selrect) + selrect-width (:width selrect) + max-width (max width selrect-width) max-height (max height selrect-height) valign (-> shape :content :vertical-align) y (:y selrect) @@ -333,7 +335,7 @@ "center" (- y (/ (- height selrect-height) 2)) "top" y) y)] - [(assoc selrect :y y :width (:width selrect) :height max-height) transform]) + [(assoc selrect :y y :width max-width :height max-height) transform]) (let [bounds (gst/shape->rect shape) x (mth/min (dm/get-prop bounds :x)