Skip to content

Commit

Permalink
Fix hit testing text inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Dec 16, 2024
1 parent 763b459 commit 6c1855b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/blitz-dom/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,22 +988,22 @@ impl Node {
let x = x - self.final_layout.location.x + self.scroll_offset.x as f32;
let y = y - self.final_layout.location.y + self.scroll_offset.y as f32;

let size = self.final_layout.size;
let matches_self = !(x < 0.0
|| x > size.width + self.scroll_offset.x as f32
|| y < 0.0
|| y > size.height + self.scroll_offset.y as f32);

let content_size = self.final_layout.content_size;
let matches_content = !(x < 0.0
|| x > content_size.width + self.scroll_offset.x as f32
|| y < 0.0
|| y > content_size.height + self.scroll_offset.y as f32);

if !matches_content {
if !matches_self && !matches_content {
return None;
}

let size = self.final_layout.size;
let matches_self = !(x < 0.0
|| x > size.width + self.scroll_offset.x as f32
|| y < 0.0
|| y > size.height + self.scroll_offset.y as f32);

// Call `.hit()` on each child in turn. If any return `Some` then return that value. Else return `Some(self.id).
self.paint_children
.borrow()
Expand Down

0 comments on commit 6c1855b

Please sign in to comment.