diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-21 14:22:01 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-21 14:22:01 +0300 |
commit | 2e7b41f2d20cee278514b84ccf131062a62b3fee (patch) | |
tree | ef12ed8bd50760678715209bc9cb3532cbb4df66 /src/ui/touch.c | |
parent | b19d76bcb518287e63c6808c6dc1418d349f4ff7 (diff) |
Touch: Stopping momentum scroll
When a widget runs out of scrollable area, stop any momentum scrolls.
Diffstat (limited to 'src/ui/touch.c')
-rw-r--r-- | src/ui/touch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/touch.c b/src/ui/touch.c index 8a532821..834fe4f8 100644 --- a/src/ui/touch.c +++ b/src/ui/touch.c | |||
@@ -696,6 +696,16 @@ iBool processEvent_Touch(const SDL_Event *ev) { | |||
696 | return iTrue; | 696 | return iTrue; |
697 | } | 697 | } |
698 | 698 | ||
699 | void stopWidgetMomentum_Touch(iWidget *widget) { | ||
700 | iTouchState *d = touchState_(); | ||
701 | iForEach(Array, i, d->moms) { | ||
702 | iMomentum *mom = i.value; | ||
703 | if (mom->affinity == widget) { | ||
704 | remove_ArrayIterator(&i); | ||
705 | } | ||
706 | } | ||
707 | } | ||
708 | |||
699 | void widgetDestroyed_Touch(iWidget *widget) { | 709 | void widgetDestroyed_Touch(iWidget *widget) { |
700 | iTouchState *d = touchState_(); | 710 | iTouchState *d = touchState_(); |
701 | iForEach(Array, i, d->touches) { | 711 | iForEach(Array, i, d->touches) { |