mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
ui/app: (wayland) restore discrete scrolling behaviour
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -1001,10 +1001,6 @@ func (w *window) flushScroll() {
|
|||||||
dist := float32(w.flinger.Tick(time.Now()))
|
dist := float32(w.flinger.Tick(time.Now()))
|
||||||
fling = w.flingDir.Mul(dist)
|
fling = w.flingDir.Mul(dist)
|
||||||
}
|
}
|
||||||
total := w.scroll.Add(fling)
|
|
||||||
if total == (f32.Point{}) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// The Wayland reported scroll distance for
|
// The Wayland reported scroll distance for
|
||||||
// discrete scroll axis is only 10 pixels, where
|
// discrete scroll axis is only 10 pixels, where
|
||||||
// 100 seems more appropriate.
|
// 100 seems more appropriate.
|
||||||
@@ -1015,6 +1011,10 @@ func (w *window) flushScroll() {
|
|||||||
if w.discScroll.Y != 0 {
|
if w.discScroll.Y != 0 {
|
||||||
w.scroll.Y *= discreteScale
|
w.scroll.Y *= discreteScale
|
||||||
}
|
}
|
||||||
|
total := w.scroll.Add(fling)
|
||||||
|
if total == (f32.Point{}) {
|
||||||
|
return
|
||||||
|
}
|
||||||
w.w.event(pointer.Event{
|
w.w.event(pointer.Event{
|
||||||
Type: pointer.Move,
|
Type: pointer.Move,
|
||||||
Source: pointer.Mouse,
|
Source: pointer.Mouse,
|
||||||
|
|||||||
Reference in New Issue
Block a user