gesture,widget: drop press markers on gesture cancel

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-08 21:44:57 +02:00
parent 652f1ecd47
commit 0444caa9e3
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -91,6 +91,8 @@ func (b *Clickable) update(gtx layout.Context) {
for _, e := range b.click.Events(gtx) {
switch e.Type {
case gesture.TypeCancel:
b.history = nil
case gesture.TypeClick:
b.clicks = append(b.clicks, Click{
Modifiers: e.Modifiers,