mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +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
@@ -53,7 +53,11 @@ func (d *Draggable) Dragging() bool {
|
||||
// requested to offer data, if any
|
||||
func (d *Draggable) Update(gtx layout.Context) (mime string, requested bool) {
|
||||
pos := d.pos
|
||||
for _, ev := range d.drag.Update(gtx.Metric, gtx.Source, gesture.Both) {
|
||||
for {
|
||||
ev, ok := d.drag.Update(gtx.Metric, gtx.Source, gesture.Both)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
switch ev.Kind {
|
||||
case pointer.Press:
|
||||
d.click = ev.Position
|
||||
|
||||
Reference in New Issue
Block a user