mod(mouse): fix input.Mouse.in method
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 46s

Pass through mouse events where they actually match the corresponding
`Container`. Adopt mouse event accordingly in `Scrollable` `Element`
trait when passing through the mouse event to the scrollable
`Container`.
This commit is contained in:
2025-02-18 19:09:03 +01:00
parent f66a870223
commit f55d71a7cb
3 changed files with 17 additions and 2 deletions

View File

@@ -36,8 +36,8 @@ pub const Mouse = packed struct {
}
pub fn in(this: @This(), size: Size) bool {
return this.col >= size.anchor.col and this.col <= size.cols -| size.anchor.col and
this.row >= size.anchor.row and this.row <= size.rows -| size.anchor.row;
return this.col >= size.anchor.col and this.col <= size.cols + size.anchor.col and
this.row >= size.anchor.row and this.row <= size.rows + size.anchor.row;
}
};