feat(gioui): flip the unit parameter slider scroll wheel behaviour

Closes #112.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-02-19 21:49:51 +02:00
parent 17312bbe4e
commit aa7a2e56fa
2 changed files with 7 additions and 1 deletions

View File

@ -235,7 +235,7 @@ func (p ParameterStyle) Layout(gtx C) D {
for _, e := range gtx.Events(&p.w.floatWidget) {
if ev, ok := e.(pointer.Event); ok && ev.Type == pointer.Scroll {
delta := math.Min(math.Max(float64(ev.Scroll.Y), -1), 1)
tracker.Int{IntData: p.w.Parameter}.Add(int(delta))
tracker.Int{IntData: p.w.Parameter}.Add(-int(delta))
}
}
gtx.Constraints.Min.X = gtx.Dp(unit.Dp(200))