Skip to content

Commit 25cf29b

Browse files
committed
debugui: bug fix: pointingDelta should return (0, 0) for a new touch
Closes #45
1 parent 4251990 commit 25cf29b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

widget.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ func (c *Context) pointingOver(bounds image.Rectangle) bool {
4444
}
4545

4646
func (c *Context) pointingDelta() image.Point {
47+
// The delta is always (0, 0) when a touch just started.
48+
if c.pointing.isTouchActive() && c.pointing.justPressed() {
49+
return image.Point{}
50+
}
4751
return c.pointingPosition().Sub(c.lastPointingPos)
4852
}
4953

0 commit comments

Comments
 (0)