Skip to content

Commit

Permalink
Reverse after flattening when iterating paint_children for hit_testing.
Browse files Browse the repository at this point in the history
The flatten step flattens an Option<Vec<T>>, so if we reverse before
flattening then we are only reversing the order of iteration over the
Option (which has no effect).
  • Loading branch information
nicoburns committed Dec 16, 2024
1 parent fa9b334 commit adb59c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/blitz-dom/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,8 @@ impl Node {
self.paint_children
.borrow()
.iter()
.rev()
.flatten()
.rev()
.find_map(|&i| self.with(i).hit(x, y))
.or(Some(HitResult {
node_id: self.id,
Expand Down

0 comments on commit adb59c1

Please sign in to comment.