From 2f65e5bdce1f285c1a0d04889a45c9a94167a091 Mon Sep 17 00:00:00 2001 From: Paulo Medeiros Date: Mon, 4 Nov 2024 12:35:28 +0100 Subject: [PATCH] layout: fix input arg on intrinsic sizes layout --- src/vaev-layout/layout.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);