Block: don't set_unrounded_layout when measuring (#971)
Signed-off-by: Nico Burns <nico@nicoburns.com>
75456ae18d076fb4c79145910c9bf1e584705157 · por Nico Burns · (hace 3 meses) · padre 983247b18 · ver el árbol en este commit
diff --git a/src/compute/block.rs b/src/compute/block.rs
index 4b39d0dfb..d8ae653df 100644
--- a/src/compute/block.rs
+++ b/src/compute/block.rs
@@ -533,6 +533,11 @@ fn compute_inner(
}
}
+ // Short-circuit if computing size
+ if run_mode == RunMode::ComputeSize {
+ return LayoutOutput::from_outer_size(final_outer_size);
+ }
+
// Commit deferred in-flow layouts to the tree. Floated items already wrote their own layouts.
for item in items.iter() {
if let Some(layout) = item.final_layout.as_ref() {
@@ -540,11 +545,6 @@ fn compute_inner(
}
}
- // Short-circuit if computing size
- if run_mode == RunMode::ComputeSize {
- return LayoutOutput::from_outer_size(final_outer_size);
- }
-
// 4. Layout absolutely positioned children
let absolute_position_inset = resolved_border + scrollbar_gutter;
let absolute_position_area = final_outer_size - absolute_position_inset.sum_axes();