diff options
author | bptato <nincsnevem662@gmail.com> | 2024-12-27 20:50:39 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-12-27 20:50:39 +0100 |
commit | 3fdb9c9ccb1ff4eb6fd5b8fde2be3725eb618b4f (patch) | |
tree | 7bbbfe2236ec5c20366ec48bbe8e9ea567a31eba /src | |
parent | 93033c2c382aaff01b1aba6f5db7652c35708bf3 (diff) | |
download | chawan-3fdb9c9ccb1ff4eb6fd5b8fde2be3725eb618b4f.tar.gz |
layout: fix a flex sizing bug
it has to accept percentage sizes too for intrinsic size clamping, it seems
Diffstat (limited to 'src')
-rw-r--r-- | src/css/layout.nim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim index a1c8d83b..6ced9740 100644 --- a/src/css/layout.nim +++ b/src/css/layout.nim @@ -1090,11 +1090,10 @@ proc resolveFlexItemSizes(lctx: LayoutContext; space: AvailableSpace; let u = length.spx(space[dim], computed, paddingSum[dim]) .minClamp(sizes.bounds.a[dim]) sizes.space[dim] = stretch(u) - if length.u == clPx: - if computed{"flex-shrink"} == 0: - sizes.bounds.mi[dim].start = max(u, sizes.bounds.mi[dim].start) - if computed{"flex-grow"} == 0: - sizes.bounds.mi[dim].send = min(u, sizes.bounds.mi[dim].send) + if computed{"flex-shrink"} == 0: + sizes.bounds.mi[dim].start = max(u, sizes.bounds.mi[dim].start) + if computed{"flex-grow"} == 0: + sizes.bounds.mi[dim].send = min(u, sizes.bounds.mi[dim].send) elif sizes.bounds.a[dim].send < LayoutUnit.high: sizes.space[dim] = fitContent(sizes.bounds.a[dim].max()) else: |