mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 11:38:24 -05:00
commit
13773d829a
2 changed files with 26 additions and 18 deletions
|
@ -171,13 +171,13 @@
|
||||||
|
|
||||||
handle-blur
|
handle-blur
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(mf/deps parse-value apply-value update-input on-blur)
|
(mf/deps parse-value apply-value update-input on-blur)
|
||||||
(fn [_]
|
(fn [_]
|
||||||
(let [new-value (or (parse-value) default-val)]
|
(let [new-value (or (parse-value) default-val)]
|
||||||
(if new-value
|
(if new-value
|
||||||
(apply-value new-value)
|
(apply-value new-value)
|
||||||
(update-input new-value)))
|
(update-input new-value)))
|
||||||
(when on-blur (on-blur))))
|
(when on-blur (on-blur))))
|
||||||
|
|
||||||
on-click
|
on-click
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
@ -203,8 +203,7 @@
|
||||||
(mf/deps value-str)
|
(mf/deps value-str)
|
||||||
(fn []
|
(fn []
|
||||||
(when-let [input-node (mf/ref-val ref)]
|
(when-let [input-node (mf/ref-val ref)]
|
||||||
(when-not (dom/active? input-node)
|
(dom/set-value! input-node value-str))))
|
||||||
(dom/set-value! input-node value-str)))))
|
|
||||||
|
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
(mf/deps handle-blur)
|
(mf/deps handle-blur)
|
||||||
|
|
|
@ -49,17 +49,26 @@
|
||||||
|
|
||||||
[width height]
|
[width height]
|
||||||
(if (or resize-x? resize-y?)
|
(if (or resize-x? resize-y?)
|
||||||
(let [pc (-> (gpt/point x y)
|
(let [pc (cond-> (gpt/point x y)
|
||||||
(gpt/transform transform)
|
(some? transform)
|
||||||
(gpt/transform current-transform))
|
(gpt/transform transform)
|
||||||
|
|
||||||
pw (-> (gpt/point (+ x width) y)
|
(some? current-transform)
|
||||||
(gpt/transform transform)
|
(gpt/transform current-transform))
|
||||||
(gpt/transform current-transform))
|
|
||||||
|
|
||||||
ph (-> (gpt/point x (+ y height))
|
pw (cond-> (gpt/point (+ x width) y)
|
||||||
(gpt/transform transform)
|
(some? transform)
|
||||||
(gpt/transform current-transform))]
|
(gpt/transform transform)
|
||||||
|
|
||||||
|
(some? current-transform)
|
||||||
|
(gpt/transform current-transform))
|
||||||
|
|
||||||
|
ph (cond-> (gpt/point x (+ y height))
|
||||||
|
(some? transform)
|
||||||
|
(gpt/transform transform)
|
||||||
|
|
||||||
|
(some? current-transform)
|
||||||
|
(gpt/transform current-transform))]
|
||||||
[(gpt/distance pc pw) (gpt/distance pc ph)])
|
[(gpt/distance pc pw) (gpt/distance pc ph)])
|
||||||
[width height])]
|
[width height])]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue