mirror of
https://github.com/penpot/penpot.git
synced 2026-07-29 09:26:14 +00:00
💄 Add mainly cosmetic changes to set-layout-child
This commit is contained in:
parent
33d6f543a1
commit
7acfd199aa
@ -546,32 +546,32 @@
|
|||||||
(defn set-grid-layout
|
(defn set-grid-layout
|
||||||
[shape]
|
[shape]
|
||||||
(set-grid-layout-data shape)
|
(set-grid-layout-data shape)
|
||||||
(set-grid-layout-rows (:layout-grid-rows shape))
|
(set-grid-layout-rows (get shape :layout-grid-rows))
|
||||||
(set-grid-layout-columns (:layout-grid-columns shape))
|
(set-grid-layout-columns (get shape :layout-grid-columns))
|
||||||
(set-grid-layout-cells (:layout-grid-cells shape)))
|
(set-grid-layout-cells (get shape :layout-grid-cells)))
|
||||||
|
|
||||||
(defn set-layout-child
|
(defn set-layout-child
|
||||||
[shape]
|
[shape]
|
||||||
(let [margins (dm/get-prop shape :layout-item-margin)
|
(let [margins (get shape :layout-item-margin)
|
||||||
margin-top (or (dm/get-prop margins :m1) 0)
|
margin-top (get margins :m1 0)
|
||||||
margin-right (or (dm/get-prop margins :m2) 0)
|
margin-right (get margins :m2 0)
|
||||||
margin-bottom (or (dm/get-prop margins :m3) 0)
|
margin-bottom (get margins :m3 0)
|
||||||
margin-left (or (dm/get-prop margins :m4) 0)
|
margin-left (get margins :m4 0)
|
||||||
|
|
||||||
h-sizing (-> (dm/get-prop shape :layout-item-h-sizing) (or :fix) sr/translate-layout-sizing)
|
h-sizing (-> (get shape :layout-item-h-sizing) sr/translate-layout-sizing)
|
||||||
v-sizing (-> (dm/get-prop shape :layout-item-v-sizing) (or :fix) sr/translate-layout-sizing)
|
v-sizing (-> (get shape :layout-item-v-sizing) sr/translate-layout-sizing)
|
||||||
align-self (-> (dm/get-prop shape :layout-item-align-self) sr/translate-align-self)
|
align-self (-> (get shape :layout-item-align-self) sr/translate-align-self)
|
||||||
|
|
||||||
max-h (dm/get-prop shape :layout-item-max-h)
|
max-h (get shape :layout-item-max-h)
|
||||||
has-max-h (some? max-h)
|
has-max-h (some? max-h)
|
||||||
min-h (dm/get-prop shape :layout-item-min-h)
|
min-h (get shape :layout-item-min-h)
|
||||||
has-min-h (some? min-h)
|
has-min-h (some? min-h)
|
||||||
max-w (dm/get-prop shape :layout-item-max-w)
|
max-w (get shape :layout-item-max-w)
|
||||||
has-max-w (some? max-w)
|
has-max-w (some? max-w)
|
||||||
min-w (dm/get-prop shape :layout-item-min-w)
|
min-w (get shape :layout-item-min-w)
|
||||||
has-min-w (some? min-w)
|
has-min-w (some? min-w)
|
||||||
is-absolute (boolean (dm/get-prop shape :layout-item-absolute))
|
is-absolute (boolean (get shape :layout-item-absolute))
|
||||||
z-index (-> (dm/get-prop shape :layout-item-z-index) (or 0))]
|
z-index (get shape :layout-item-z-index)]
|
||||||
(h/call wasm/internal-module
|
(h/call wasm/internal-module
|
||||||
"_set_layout_child_data"
|
"_set_layout_child_data"
|
||||||
margin-top
|
margin-top
|
||||||
@ -581,17 +581,17 @@
|
|||||||
h-sizing
|
h-sizing
|
||||||
v-sizing
|
v-sizing
|
||||||
has-max-h
|
has-max-h
|
||||||
(or max-h 0)
|
(d/nilv max-h 0)
|
||||||
has-min-h
|
has-min-h
|
||||||
(or min-h 0)
|
(d/nilv min-h 0)
|
||||||
has-max-w
|
has-max-w
|
||||||
(or max-w 0)
|
(d/nilv max-w 0)
|
||||||
has-min-w
|
has-min-w
|
||||||
(or min-w 0)
|
(d/nilv min-w 0)
|
||||||
(some? align-self)
|
(some? align-self)
|
||||||
(or align-self 0)
|
(d/nilv align-self 0)
|
||||||
is-absolute
|
is-absolute
|
||||||
z-index)))
|
(d/nilv z-index))))
|
||||||
|
|
||||||
(defn clear-layout
|
(defn clear-layout
|
||||||
[]
|
[]
|
||||||
|
|||||||
@ -227,7 +227,8 @@
|
|||||||
(case value
|
(case value
|
||||||
:fill 0
|
:fill 0
|
||||||
:fix 1
|
:fix 1
|
||||||
:auto 2))
|
:auto 2
|
||||||
|
1))
|
||||||
|
|
||||||
(defn translate-align-self
|
(defn translate-align-self
|
||||||
[value]
|
[value]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user