mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05: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/WatchEvent
|
||||
(watch [_ state _]
|
||||
(let [page-id (:current-page-id state)
|
||||
objects (wsh/lookup-page-objects state page-id)
|
||||
shape (get objects id)
|
||||
(let [page-id (:current-page-id state)
|
||||
objects (wsh/lookup-page-objects state page-id)
|
||||
shape (get objects id)
|
||||
|
||||
;; FIXME: performance rect
|
||||
bbox (-> shape :points grc/points->rect)
|
||||
bbox (-> shape :points grc/points->rect)
|
||||
|
||||
cpos (gpt/point (:x bbox) (:y bbox))
|
||||
pos (gpt/point (or (:x position) (:x bbox))
|
||||
(or (:y position) (:y bbox)))
|
||||
cpos (gpt/point (:x bbox) (:y bbox))
|
||||
pos (gpt/point (or (:x position) (:x 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))]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue