Skip to content

Commit

Permalink
fix: Traverse layout-mutated children with no drawing area in composi…
Browse files Browse the repository at this point in the history
…tor (#971)
  • Loading branch information
marc2332 authored Oct 9, 2024
1 parent b92e110 commit 07c35c6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions crates/core/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,23 @@ pub fn process_layout(
let mut compositor_dirty_area = fdom.compositor_dirty_area();
let mut buffer = layout.dirty.iter().copied().collect_vec();
while let Some(node_id) = buffer.pop() {
if let Some(area) = Compositor::get_drawing_area(node_id, &layout, rdom, scale_factor) {
// Unite the invalidated area with the dirty area
compositor_dirty_area.unite_or_insert(&area);
if let Some(node) = rdom.get(node_id) {
if let Some(area) =
Compositor::get_drawing_area(node_id, &layout, rdom, scale_factor)
{
// Unite the invalidated area with the dirty area
compositor_dirty_area.unite_or_insert(&area);

// Mark these elements as dirty for the compositor
compositor_dirty_nodes.insert(node_id);
// Mark these elements as dirty for the compositor
compositor_dirty_nodes.insert(node_id);

// Continue iterating in the children of this node
if let Some(node) = rdom.get(node_id) {
// Mark as invalidated this node as its layout has changed
if node.get_accessibility_id().is_some() {
dirty_accessibility_tree.add_or_update(node_id);
}

buffer.extend(node.child_ids());
}
// Continue iterating in the children of this node
buffer.extend(node.child_ids());
}
}
let root_id = fdom.rdom().root_id();
Expand Down

0 comments on commit 07c35c6

Please sign in to comment.