mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
🐛 Align-items center/end weren't respected when layout was outside bounds
This commit is contained in:
parent
48c3e3e00b
commit
7c215dc11b
2 changed files with 22 additions and 3 deletions
|
@ -20,9 +20,13 @@
|
|||
hv (partial gpo/start-hv layout-bounds)
|
||||
vv (partial gpo/start-vv layout-bounds)
|
||||
|
||||
end? (ctl/content-end? parent)
|
||||
center? (ctl/content-center? parent)
|
||||
around? (ctl/content-around? parent)
|
||||
wrap? (ctl/wrap? parent)
|
||||
|
||||
end? (or (and wrap? (ctl/content-end? parent))
|
||||
(and (not wrap?) (ctl/align-items-end? parent)))
|
||||
center? (or (and wrap? (ctl/content-center? parent))
|
||||
(and (not wrap?) (ctl/align-items-center? parent)))
|
||||
around? (and wrap? (ctl/content-around? parent))
|
||||
|
||||
;; Adjust the totals so it takes into account the gaps
|
||||
[layout-gap-row layout-gap-col] (ctl/gaps parent)
|
||||
|
|
|
@ -275,6 +275,21 @@
|
|||
(or (= :stretch layout-align-content)
|
||||
(nil? layout-align-content)))
|
||||
|
||||
(defn align-items-center?
|
||||
[{:keys [layout-align-items]}]
|
||||
(= layout-align-items :center))
|
||||
|
||||
(defn align-items-start?
|
||||
[{:keys [layout-align-items]}]
|
||||
(= layout-align-items :start))
|
||||
|
||||
(defn align-items-end?
|
||||
[{:keys [layout-align-items]}]
|
||||
(= layout-align-items :end))
|
||||
|
||||
(defn align-items-stretch?
|
||||
[{:keys [layout-align-items]}]
|
||||
(= layout-align-items :stretch))
|
||||
|
||||
(defn reverse?
|
||||
[{:keys [layout-flex-dir]}]
|
||||
|
|
Loading…
Reference in a new issue