mirror of
https://github.com/penpot/penpot.git
synced 2025-05-26 01:06:14 +02:00
✨ Improved canvas displacement on options.
This commit is contained in:
parent
35e50dc47c
commit
8f77a59a97
1 changed files with 9 additions and 4 deletions
|
@ -36,10 +36,15 @@
|
||||||
|
|
||||||
on-position-change
|
on-position-change
|
||||||
(fn [event attr]
|
(fn [event attr]
|
||||||
(let [value (-> (dom/get-target event)
|
(let [cval (-> (dom/get-target event)
|
||||||
(dom/get-value)
|
(dom/get-value)
|
||||||
(d/parse-integer))]
|
(d/parse-integer))
|
||||||
(st/emit! (udw/update-position (:id shape) {attr value}))))
|
pval (get shape attr)
|
||||||
|
delta (if (= attr :x)
|
||||||
|
(gpt/point (math/neg (- pval cval)) 0)
|
||||||
|
(gpt/point 0 (math/neg (- pval cval))))]
|
||||||
|
(st/emit! (udw/apply-canvas-displacement (:id shape) delta)
|
||||||
|
(udw/materialize-canvas-displacement (:id shape)))))
|
||||||
|
|
||||||
on-width-change #(on-size-change % :width)
|
on-width-change #(on-size-change % :width)
|
||||||
on-height-change #(on-size-change % :height)
|
on-height-change #(on-size-change % :height)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue