From ae25d704c15dad5b015be4c7a0699c3f1b72f3e7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 21 Jul 2025 09:32:44 +0200 Subject: [PATCH] :paperclip: Add missing use-fn hook --- .../main/ui/workspace/viewport/selection.cljs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/viewport/selection.cljs b/frontend/src/app/main/ui/workspace/viewport/selection.cljs index 9cd2a10c3c..8b304eb2b7 100644 --- a/frontend/src/app/main/ui/workspace/viewport/selection.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/selection.cljs @@ -291,13 +291,18 @@ (if ^boolean scale-text (cur/get-dynamic "scale-ns" rotation) (cur/get-dynamic "resize-ns" rotation))) - on-double-click (fn [_] - (when (= shape-type :text) - (cond - (= position :right) - (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-width))) - (= position :bottom) - (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-height))))))] + + on-double-click + (mf/use-fn + (mf/deps shape-id position shape-type) + (fn [_event] + (when (= shape-type :text) + (cond + (= position :right) + (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-width))) + (= position :bottom) + (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-height)))))))] + [:g.resize-handler (when ^boolean show-handler [:circle {:r (/ resize-point-radius zoom)