Skip to content

Commit

Permalink
layout: fix input arg on intrinsic sizes layout
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloamed committed Nov 4, 2024
1 parent 456112a commit 2f65e5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vaev-layout/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Vec2Px computeIntrinsicSize(Tree &tree, Box &box, IntrinsicSize intrinsic, Vec2P
box,
{
.commit = Commit::NO,
.intrinsic = intrinsic,
.knownSize = {NONE, NONE},
}
);
Expand All @@ -122,10 +123,10 @@ Vec2Px computeIntrinsicSize(Tree &tree, Box &box, IntrinsicSize intrinsic, Vec2P
static Opt<Px> _computeSpecifiedSize(Tree &tree, Box &box, Size size, Vec2Px containingBlock, bool isWidth) {
if (size == Size::MIN_CONTENT) {
auto intrinsicSize = computeIntrinsicSize(tree, box, IntrinsicSize::MIN_CONTENT, containingBlock);
return isWidth ? intrinsicSize.x : intrinsicSize.y;
return isWidth ? Opt<Px>{intrinsicSize.x} : Opt<Px>{NONE};
} else if (size == Size::MAX_CONTENT) {
auto intrinsicSize = computeIntrinsicSize(tree, box, IntrinsicSize::MAX_CONTENT, containingBlock);
return isWidth ? intrinsicSize.x : intrinsicSize.y;
return isWidth ? Opt<Px>{intrinsicSize.x} : Opt<Px>{NONE};
} else if (size == Size::FIT_CONTENT) {
auto minIntrinsicSize = computeIntrinsicSize(tree, box, IntrinsicSize::MIN_CONTENT, containingBlock);
auto maxIntrinsicSize = computeIntrinsicSize(tree, box, IntrinsicSize::MAX_CONTENT, containingBlock);
Expand Down

0 comments on commit 2f65e5b

Please sign in to comment.