Skip to content

Commit

Permalink
Use layout parent instead of parent when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Oct 23, 2024
1 parent e74aace commit c30888f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/blitz-dom/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,15 +948,15 @@ impl Document {
while let Some(id) = maybe_id {
self.snapshot_node_and(id, |node| {
node.unhover();
maybe_id = node.parent;
maybe_id = node.layout_parent.get();
});
}

let mut maybe_id = hover_node_id;
while let Some(id) = maybe_id {
self.snapshot_node_and(id, |node| {
node.hover();
maybe_id = node.parent;
maybe_id = node.layout_parent.get();
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/blitz-renderer-vello/src/renderer/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl VelloSceneGenerator<'_> {

let mut abs_x = x;
let mut abs_y = y;
while let Some(parent_id) = node.parent {
while let Some(parent_id) = node.layout_parent.get() {
node = &self.dom.as_ref().tree()[parent_id];
let taffy::Point { x, y } = node.final_layout.location;
abs_x += x;
Expand Down

0 comments on commit c30888f

Please sign in to comment.