mirror of
https://github.com/penpot/penpot.git
synced 2026-04-30 21:59:10 +00:00
📎 Add missing use-fn hook
This commit is contained in:
parent
e05f8c0329
commit
ae25d704c1
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user