mirror of
https://github.com/penpot/penpot.git
synced 2025-01-06 14:50:20 -05:00
Fix position updating
This commit is contained in:
parent
9340ba9cc0
commit
5e33eab7d0
2 changed files with 7 additions and 4 deletions
|
@ -158,8 +158,11 @@
|
|||
(dwsl/update-layout [shape-id] layout-update)))))))
|
||||
|
||||
(defn update-shape-position [value shape-ids attributes]
|
||||
(doseq [shape-id shape-ids]
|
||||
(st/emit! (dwt/update-position shape-id {(first attributes) value}))))
|
||||
(ptk/reify ::update-shape-position
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(rx/concat
|
||||
(map #(dwt/update-position % (zipmap attributes (repeat value))) shape-ids)))))
|
||||
|
||||
(defn update-layout-sizing-limits [value shape-ids attributes]
|
||||
(ptk/reify ::update-layout-sizing-limits
|
||||
|
|
|
@ -198,8 +198,8 @@
|
|||
{:title "Border Radius" :submenu :border-radius}]
|
||||
(stroke-width context-data)
|
||||
[:separator]
|
||||
(generic-attribute-actions #{:x} "X" context-data)
|
||||
(generic-attribute-actions #{:y} "Y" context-data)))}))
|
||||
(generic-attribute-actions #{:x} "X" (assoc context-data :on-update-shape wtch/update-shape-position))
|
||||
(generic-attribute-actions #{:y} "Y" (assoc context-data :on-update-shape wtch/update-shape-position))))}))
|
||||
|
||||
(defn default-actions [{:keys [token]}]
|
||||
(let [{:keys [modal]} (wtty/get-token-properties token)]
|
||||
|
|
Loading…
Reference in a new issue