mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
io/pointer: [API] split scroll bounds into two separate axes
A single image.Rectangle for the scroll bounds introduced a subtle issue with zero area rectangles (see #572). To avoid that and similar issues, split the bounds into two separate one-dimensional ranges. Fixes: https://todo.sr.ht/~eliasnaur/gio/572 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -251,9 +251,10 @@ func TestFocusScroll(t *testing.T) {
|
||||
filters := []event.Filter{
|
||||
key.FocusFilter{Target: h},
|
||||
pointer.Filter{
|
||||
Target: h,
|
||||
Kinds: pointer.Scroll,
|
||||
ScrollBounds: image.Rect(-100, -100, 100, 100),
|
||||
Target: h,
|
||||
Kinds: pointer.Scroll,
|
||||
ScrollX: pointer.ScrollRange{Min: -100, Max: +100},
|
||||
ScrollY: pointer.ScrollRange{Min: -100, Max: +100},
|
||||
},
|
||||
}
|
||||
events(r, -1, filters...)
|
||||
|
||||
Reference in New Issue
Block a user