mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
🐛 Fix problem with flex direction
This commit is contained in:
parent
baf9124304
commit
2a46989ec9
3 changed files with 4 additions and 4 deletions
|
@ -141,7 +141,7 @@
|
||||||
[frame layout-data children]
|
[frame layout-data children]
|
||||||
|
|
||||||
(let [reverse? (:reverse? layout-data)
|
(let [reverse? (:reverse? layout-data)
|
||||||
children (vec (cond->> (d/enumerate children) reverse? reverse))
|
children (vec (cond->> (d/enumerate children) (not reverse?) reverse))
|
||||||
lines (:layout-lines layout-data)]
|
lines (:layout-lines layout-data)]
|
||||||
|
|
||||||
(loop [areas []
|
(loop [areas []
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
areas
|
areas
|
||||||
|
|
||||||
(let [[child-area child-area-start child-area-end]
|
(let [[child-area child-area-start child-area-end]
|
||||||
(drop-child-areas frame line-area child index reverse? prev-child-x prev-child-y (nil? (first children)))]
|
(drop-child-areas frame line-area child index (not reverse?) prev-child-x prev-child-y (nil? (first children)))]
|
||||||
(recur (conj areas child-area-start child-area-end)
|
(recur (conj areas child-area-start child-area-end)
|
||||||
(+ (:x child-area) (:width child-area))
|
(+ (:x child-area) (:width child-area))
|
||||||
(+ (:y child-area) (:height child-area))
|
(+ (:y child-area) (:height child-area))
|
||||||
|
|
|
@ -304,7 +304,7 @@
|
||||||
|
|
||||||
(let [layout-bounds (layout-bounds shape)
|
(let [layout-bounds (layout-bounds shape)
|
||||||
reverse? (ctl/reverse? shape)
|
reverse? (ctl/reverse? shape)
|
||||||
children (cond->> children reverse? reverse)
|
children (cond->> children (not reverse?) reverse)
|
||||||
|
|
||||||
;; Creates the layout lines information
|
;; Creates the layout lines information
|
||||||
layout-lines
|
layout-lines
|
||||||
|
|
|
@ -159,7 +159,7 @@
|
||||||
(let [children (map (d/getf objects) (:shapes parent))
|
(let [children (map (d/getf objects) (:shapes parent))
|
||||||
children (->> children (map (partial apply-modifiers modif-tree)))
|
children (->> children (map (partial apply-modifiers modif-tree)))
|
||||||
layout-data (gcl/calc-layout-data parent children)
|
layout-data (gcl/calc-layout-data parent children)
|
||||||
children (into [] (cond-> children (:reverse? layout-data) reverse))
|
children (into [] (cond-> children (not (:reverse? layout-data)) reverse))
|
||||||
max-idx (dec (count children))
|
max-idx (dec (count children))
|
||||||
layout-lines (:layout-lines layout-data)]
|
layout-lines (:layout-lines layout-data)]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue