From 0e7060d5306fef1f585982cc78223250d3ee8551 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 12 Sep 2021 21:00:44 +0300 Subject: Mobile: Better Settings tap targets; fixed safe area drawing --- src/ui/touch.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui/touch.c') diff --git a/src/ui/touch.c b/src/ui/touch.c index f0456acb..5fc8f245 100644 --- a/src/ui/touch.c +++ b/src/ui/touch.c @@ -254,6 +254,8 @@ static iFloat3 gestureVector_Touch_(const iTouch *d) { } static void update_TouchState_(void *ptr) { + iWindow *win = get_Window(); + const iWidget *oldHover = win->hover; iTouchState *d = ptr; /* Check for long presses to simulate right clicks. */ const uint32_t nowTime = SDL_GetTicks(); @@ -293,6 +295,7 @@ static void update_TouchState_(void *ptr) { /* Looks like a possible tap. */ dispatchNotification_Touch_(touch, widgetTapBegins_UserEventCode); dispatchMotion_Touch_(touch->pos[0], 0); + refresh_Widget(touch->affinity); touch->isTapBegun = iTrue; } if (!touch->isTapAndHold && nowTime - touch->startTime >= longPressSpanMs_ && @@ -363,6 +366,10 @@ static void update_TouchState_(void *ptr) { if (!isEmpty_Array(d->touches) || !isEmpty_Array(d->moms)) { addTickerRoot_App(update_TouchState_, NULL, ptr); } + if (oldHover != win->hover) { + refresh_Widget(oldHover); + refresh_Widget(win->hover); + } } #if 0 -- cgit v1.2.3