diff --git a/src/vaev-layout/layout.cpp b/src/vaev-layout/layout.cpp index d80c71f..4092970 100644 --- a/src/vaev-layout/layout.cpp +++ b/src/vaev-layout/layout.cpp @@ -112,6 +112,7 @@ Vec2Px computeIntrinsicSize(Tree &tree, Box &box, IntrinsicSize intrinsic, Vec2P box, { .commit = Commit::NO, + .intrinsic = intrinsic, .knownSize = {NONE, NONE}, } ); @@ -122,10 +123,10 @@ Vec2Px computeIntrinsicSize(Tree &tree, Box &box, IntrinsicSize intrinsic, Vec2P static Opt _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{intrinsicSize.x} : Opt{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{intrinsicSize.x} : Opt{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);