mirror of
https://github.com/penpot/penpot.git
synced 2025-07-31 17:08:37 +02:00
💄 Add cosmetic improvements to update-position fn
This commit is contained in:
parent
e97aab4c7f
commit
c1013c359d
1 changed files with 8 additions and 8 deletions
|
@ -712,18 +712,18 @@
|
||||||
(ptk/reify ::update-position
|
(ptk/reify ::update-position
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [page-id (:current-page-id state)
|
(let [page-id (:current-page-id state)
|
||||||
objects (wsh/lookup-page-objects state page-id)
|
objects (wsh/lookup-page-objects state page-id)
|
||||||
shape (get objects id)
|
shape (get objects id)
|
||||||
|
|
||||||
;; FIXME: performance rect
|
;; FIXME: performance rect
|
||||||
bbox (-> shape :points grc/points->rect)
|
bbox (-> shape :points grc/points->rect)
|
||||||
|
|
||||||
cpos (gpt/point (:x bbox) (:y bbox))
|
cpos (gpt/point (:x bbox) (:y bbox))
|
||||||
pos (gpt/point (or (:x position) (:x bbox))
|
pos (gpt/point (or (:x position) (:x bbox))
|
||||||
(or (:y position) (:y bbox)))
|
(or (:y position) (:y bbox)))
|
||||||
|
|
||||||
delta (gpt/subtract pos cpos)
|
delta (gpt/subtract pos cpos)
|
||||||
|
|
||||||
modif-tree (dwm/create-modif-tree [id] (ctm/move-modifiers delta))]
|
modif-tree (dwm/create-modif-tree [id] (ctm/move-modifiers delta))]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue