summaryrefslogtreecommitdiff
path: root/src/ui/touch.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 13:25:44 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 13:25:44 +0300
commit379c1f8befcc30b72f0b50dcbd653704348e4761 (patch)
treea43c0d30f39e592237bf7f3b9c8fca26434128d0 /src/ui/touch.c
parent3846778c99d9efca609b7cb216cb71c675f036b0 (diff)
UI root sizing is independent of window sizing
Diffstat (limited to 'src/ui/touch.c')
-rw-r--r--src/ui/touch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/touch.c b/src/ui/touch.c
index 75bbf765..6867a34b 100644
--- a/src/ui/touch.c
+++ b/src/ui/touch.c
@@ -335,7 +335,7 @@ static void update_TouchState_(void *ptr) {
335} 335}
336 336
337static iWidget *findOverflowScrollable_Widget_(iWidget *d) { 337static iWidget *findOverflowScrollable_Widget_(iWidget *d) {
338 const iInt2 rootSize = rootSize_Window(get_Window()); 338 const iInt2 rootSize = size_Root(get_Root());
339 for (iWidget *w = d; w; w = parent_Widget(w)) { 339 for (iWidget *w = d; w; w = parent_Widget(w)) {
340 if (flags_Widget(w) & overflowScrollable_WidgetFlag) { 340 if (flags_Widget(w) & overflowScrollable_WidgetFlag) {
341 if (height_Widget(w) > rootSize.y && !hasVisibleChildOnTop_Widget(w)) { 341 if (height_Widget(w) > rootSize.y && !hasVisibleChildOnTop_Widget(w)) {
@@ -437,11 +437,11 @@ iBool processEvent_Touch(const SDL_Event *ev) {
437 return iFalse; 437 return iFalse;
438 } 438 }
439 iTouchState *d = touchState_(); 439 iTouchState *d = touchState_();
440 iWindow *window = get_Window(); 440 iWindow *window = get_Window();
441 if (!isFinished_Anim(&window->rootOffset)) { 441 if (!isFinished_Anim(&window->rootOffset)) {
442 return iFalse; 442 return iFalse;
443 } 443 }
444 const iInt2 rootSize = rootSize_Window(window); 444 const iInt2 rootSize = size_Root(get_Root());
445 const SDL_TouchFingerEvent *fing = &ev->tfinger; 445 const SDL_TouchFingerEvent *fing = &ev->tfinger;
446 const iFloat3 pos = add_F3(init_F3(fing->x * rootSize.x, fing->y * rootSize.y, 0), /* pixels */ 446 const iFloat3 pos = add_F3(init_F3(fing->x * rootSize.x, fing->y * rootSize.y, 0), /* pixels */
447 init_F3(0, -value_Anim(&window->rootOffset), 0)); 447 init_F3(0, -value_Anim(&window->rootOffset), 0));