mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix three flex layout bugs in drop-area, positions and layout-data
drop_area.cljc: v-end? was guarded by row? instead of col?, making vertical-end alignment check fire under horizontal layout conditions. Aligned with v-center? which correctly uses col?. positions.cljc: In get-base-line, the col? around? branch passed 2 as a third argument to max instead of as a divisor in (/ free-width num-lines 2). This made the offset clamp to at least 2 pixels rather than computing half the per-line free space. Fixed parenthesization. layout_data.cljc: The second cond branch (and col? space-evenly? auto-height?) was permanently unreachable because the preceding branch (and col? space-evenly?) is a strict superset. Removed the dead branch. Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
8bdc8088b8
commit
b66b39735a
@ -81,7 +81,7 @@
|
||||
h-center? (and row? (ctl/h-center? frame))
|
||||
h-end? (and row? (ctl/h-end? frame))
|
||||
v-center? (and col? (ctl/v-center? frame))
|
||||
v-end? (and row? (ctl/v-end? frame))
|
||||
v-end? (and col? (ctl/v-end? frame))
|
||||
|
||||
center (gco/shape->center frame)
|
||||
start-p (gmt/transform-point-center start-p center transform-inverse)
|
||||
|
||||
@ -369,9 +369,6 @@
|
||||
(cond (and col? space-evenly?)
|
||||
0
|
||||
|
||||
(and col? space-evenly? auto-height?)
|
||||
0
|
||||
|
||||
(and col? space-around?)
|
||||
(/ (max layout-gap-row (/ (- height line-height) num-children)) 2)
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
(gpt/add (hv free-width-gap))
|
||||
|
||||
around?
|
||||
(gpt/add (hv (max lines-gap-col (/ free-width num-lines) 2)))
|
||||
(gpt/add (hv (max lines-gap-col (/ free-width num-lines 2))))
|
||||
|
||||
evenly?
|
||||
(gpt/add (hv (max lines-gap-col (/ free-width (inc num-lines)))))))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user