summaryrefslogtreecommitdiff
path: root/src/ui/touch.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-21 14:22:01 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-21 14:22:01 +0300
commit2e7b41f2d20cee278514b84ccf131062a62b3fee (patch)
treeef12ed8bd50760678715209bc9cb3532cbb4df66 /src/ui/touch.c
parentb19d76bcb518287e63c6808c6dc1418d349f4ff7 (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.c10
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
699void 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
699void widgetDestroyed_Touch(iWidget *widget) { 709void widgetDestroyed_Touch(iWidget *widget) {
700 iTouchState *d = touchState_(); 710 iTouchState *d = touchState_();
701 iForEach(Array, i, d->touches) { 711 iForEach(Array, i, d->touches) {