Skip to content

Commit

Permalink
Fix formattingFix formattin
Browse files Browse the repository at this point in the history
  • Loading branch information
okratitan committed Oct 10, 2020
1 parent fec7c1c commit bd15c5e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,20 +744,20 @@ func (w *window) waitForDoubleTap(co fyne.CanvasObject, ev *fyne.PointEvent) {
defer w.mouseCancelFunc()

<-ctx.Done()
if w.mouseClickCount == 2 && w.mouseLastClick == co {
if wid, ok := co.(fyne.DoubleTappable); ok {
w.queueEvent(func() { wid.DoubleTapped(ev) })
}
} else if co == w.mousePressed {
if wid, ok := co.(fyne.Tappable); ok {
w.queueEvent(func() { wid.Tapped(ev) })
}
if w.mouseClickCount == 2 && w.mouseLastClick == co {
if wid, ok := co.(fyne.DoubleTappable); ok {
w.queueEvent(func() { wid.DoubleTapped(ev) })
}
w.mouseClickCount = 0
w.mousePressed = nil
w.mouseCancelFunc = nil
w.mouseLastClick = nil
return
} else if co == w.mousePressed {
if wid, ok := co.(fyne.Tappable); ok {
w.queueEvent(func() { wid.Tapped(ev) })
}
}
w.mouseClickCount = 0
w.mousePressed = nil
w.mouseCancelFunc = nil
w.mouseLastClick = nil
return
}

func (w *window) mouseScrolled(viewport *glfw.Window, xoff float64, yoff float64) {
Expand Down
24 changes: 12 additions & 12 deletions internal/driver/gomobile/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,19 +479,19 @@ func (c *mobileCanvas) waitForDoubleTap(co fyne.CanvasObject, ev *fyne.PointEven
ctx, c.touchCancelFunc = context.WithDeadline(context.TODO(), time.Now().Add(time.Millisecond*doubleClickDelay))
defer c.touchCancelFunc()
<-ctx.Done()
if c.touchTapCount == 2 && c.touchLastTapped == co {
if wid, ok := co.(fyne.DoubleTappable); ok {
doubleTapCallback(wid, ev)
}
} else {
if wid, ok := co.(fyne.Tappable); ok {
tapCallback(wid, ev)
}
if c.touchTapCount == 2 && c.touchLastTapped == co {
if wid, ok := co.(fyne.DoubleTappable); ok {
doubleTapCallback(wid, ev)
}
c.touchTapCount = 0
c.touchCancelFunc = nil
c.touchLastTapped = nil
return
} else {
if wid, ok := co.(fyne.Tappable); ok {
tapCallback(wid, ev)
}
}
c.touchTapCount = 0
c.touchCancelFunc = nil
c.touchLastTapped = nil
return
}

func (c *mobileCanvas) setupThemeListener() {
Expand Down

0 comments on commit bd15c5e

Please sign in to comment.