Skip to content

Commit

Permalink
Convert resolve_flexible_lengths #2 to use compute_node_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Sep 13, 2022
1 parent c86a016 commit 03c6f5c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/flexbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,19 +893,18 @@ fn resolve_flexible_lengths(
// webkit handled various scenarios. Can probably be solved better by passing in
// min-content max-content constraints from the top. Need to figure out correct thing to do here as
// just piling on more conditionals.

let min_main = if constants.is_row && !tree.needs_measure(child.node) {
compute_preliminary(
tree,
let min_content_size = tree.compute_node_layout(
child.node,
Size::max_content(),
Size::undefined(),
available_space,
LayoutMode::ContainerSize,
false,
)
.width
.maybe_min(child.size.width)
.maybe_max(child.min_size.width)
.into()
ClampMode::NoClamp,
SizingMode::ContentSize,
1,
);
min_content_size.width.maybe_min(child.size.width).maybe_max(child.min_size.width).into()
} else {
child.min_size.main(constants.dir)
};
Expand Down

0 comments on commit 03c6f5c

Please sign in to comment.