From c30888fa359264db70f29ea989e7fe47465a4123 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Wed, 23 Oct 2024 17:39:11 +0900 Subject: [PATCH] Use layout parent instead of parent when appropriate --- packages/blitz-dom/src/document.rs | 4 ++-- packages/blitz-renderer-vello/src/renderer/render.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/blitz-dom/src/document.rs b/packages/blitz-dom/src/document.rs index 5dec9abf..420017b6 100644 --- a/packages/blitz-dom/src/document.rs +++ b/packages/blitz-dom/src/document.rs @@ -948,7 +948,7 @@ 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(); }); } @@ -956,7 +956,7 @@ impl Document { while let Some(id) = maybe_id { self.snapshot_node_and(id, |node| { node.hover(); - maybe_id = node.parent; + maybe_id = node.layout_parent.get(); }); } diff --git a/packages/blitz-renderer-vello/src/renderer/render.rs b/packages/blitz-renderer-vello/src/renderer/render.rs index 99b9ec01..4b7c8fdd 100644 --- a/packages/blitz-renderer-vello/src/renderer/render.rs +++ b/packages/blitz-renderer-vello/src/renderer/render.rs @@ -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;