mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
gesture: report one event at a time
Events are now delivered one at a time, and this change makes the corresponding change to gestures. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-1
@@ -48,7 +48,11 @@ func (f *Float) Layout(gtx layout.Context, axis layout.Axis, pointerMargin unit.
|
||||
// The range of f is set by the minimum constraints main axis value.
|
||||
func (f *Float) Update(gtx layout.Context) bool {
|
||||
changed := false
|
||||
for _, e := range f.drag.Update(gtx.Metric, gtx.Source, gesture.Axis(f.axis)) {
|
||||
for {
|
||||
e, ok := f.drag.Update(gtx.Metric, gtx.Source, gesture.Axis(f.axis))
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
if f.length > 0 && (e.Kind == pointer.Press || e.Kind == pointer.Drag) {
|
||||
pos := e.Position.X
|
||||
if f.axis == layout.Vertical {
|
||||
|
||||
Reference in New Issue
Block a user