mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget: correctly set s.dragging to false when releasing drag
Before, we would set s.dragging to false on pointer.Release and then immediately set it back to true because we were processing the event and saw that s.dragging was false. Signed-off-by: Dominik Honnef <dominik@honnef.co>
This commit is contained in:
committed by
Elias Naur
parent
ea37124686
commit
8f990a6fdc
+1
-3
@@ -65,9 +65,7 @@ func (s *Scrollbar) Layout(gtx layout.Context, axis layout.Axis, viewportStart,
|
||||
for _, event := range s.drag.Events(gtx.Metric, gtx, gesture.Axis(axis)) {
|
||||
switch event.Type {
|
||||
case pointer.Drag:
|
||||
case pointer.Release:
|
||||
s.dragging = false
|
||||
case pointer.Cancel:
|
||||
case pointer.Release, pointer.Cancel:
|
||||
s.dragging = false
|
||||
continue
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user