mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Convert layout spacing to function
This commit is contained in:
@@ -85,14 +85,17 @@
|
|||||||
(udw/increase-rotation shape-ids value)))))
|
(udw/increase-rotation shape-ids value)))))
|
||||||
|
|
||||||
(defn update-layout-spacing-column [value shape-ids]
|
(defn update-layout-spacing-column [value shape-ids]
|
||||||
(doseq [shape-id shape-ids]
|
(ptk/reify ::update-layout-spacing-column
|
||||||
(let [shape (dt/get-shape-from-state shape-id @st/state)
|
ptk/WatchEvent
|
||||||
|
(watch [_ state _]
|
||||||
|
(rx/concat
|
||||||
|
(for [shape-id shape-ids]
|
||||||
|
(let [shape (dt/get-shape-from-state shape-id state)
|
||||||
layout-direction (:layout-flex-dir shape)
|
layout-direction (:layout-flex-dir shape)
|
||||||
layout-update (if (or (= layout-direction :row-reverse) (= layout-direction :row))
|
layout-update (if (or (= layout-direction :row-reverse) (= layout-direction :row))
|
||||||
{:layout-gap {:column-gap value}}
|
{:layout-gap {:column-gap value}}
|
||||||
{:layout-gap {:row-gap value}})]
|
{:layout-gap {:row-gap value}})]
|
||||||
(st/emit!
|
(dwsl/update-layout [shape-id] layout-update)))))))
|
||||||
(dwsl/update-layout [shape-id] layout-update)))))
|
|
||||||
|
|
||||||
;; Events ----------------------------------------------------------------------
|
;; Events ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user