0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 21:09:00 -05:00

🐛 Fixes problems with options panel

This commit is contained in:
alonso.torres 2020-04-24 14:23:02 +02:00
parent de476383bd
commit 6d1a676f2f
3 changed files with 13 additions and 9 deletions

View file

@ -1414,14 +1414,15 @@
(us/verify ::us/uuid id)
(us/verify ::position position)
(ptk/reify ::update-position
IUpdateGroup
(get-ids [_] [id])
ptk/UpdateEvent
(update [_ state]
(let [page-id (:current-page-id state)]
(update-in state [:workspace-data page-id :objects id]
geom/absolute-move position)))))
ptk/WatchEvent
(watch [_ state stream]
(let [page-id (:current-page-id state)
shape (get-in state [:workspace-data page-id :objects id])
current-position (gpt/point (:x shape) (:y shape))
position (gpt/point (or (:x position) (:x shape)) (or (:y position) (:y shape)))
displacement (gmt/translate-matrix (gpt/subtract position current-position))]
(rx/of (transforms/set-modifiers [id] {:displacement displacement})
(transforms/apply-modifiers [id]))))))
;; --- Path Modifications
@ -1744,6 +1745,7 @@
(def start-move-selected transforms/start-move-selected)
(def move-selected transforms/move-selected)
(def set-rotation transforms/set-rotation)
(def set-modifiers transforms/set-modifiers)
(def apply-modifiers transforms/apply-modifiers)

View file

@ -313,3 +313,4 @@
(let [page-id (:current-page-id state)]
(rx/of (common/diff-and-commit-changes page-id)
(common/rehash-shape-frame-relationship ids))))))

View file

@ -67,7 +67,8 @@
(let [value (-> (dom/get-target event)
(dom/get-value)
(d/parse-integer 0))]
(st/emit! (udw/update-shape (:id shape) {:rotation value}))))
(st/emit! (udw/set-rotation (- value (:rotation shape)) [shape])
(udw/apply-modifiers #{(:id shape)}))))
on-radius-change
(fn [event]