Skip to content

Commit

Permalink
maybe that will fix the error
Browse files Browse the repository at this point in the history
  • Loading branch information
sonphantrung authored Jan 28, 2025
1 parent 5c5ed59 commit d34df6c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ static void CheckMessages()
dbg( D_INFO ) << "Fingermotion triggered.";
dbg( D_INFO ) << "ev.tfinger.fingerId: " << ev.tfinger.fingerId;
dbg( D_INFO ) << "ev.tfinger.touchId: " << ev.tfinger.touchId;
if( SDL_GetNumTouchFingers() == 1 ) {
if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 1 ) {
if( !is_quick_shortcut_touch ) {
dbg( D_INFO ) << "Not quick shortcut touch";
update_finger_repeat_delay();
Expand All @@ -3369,10 +3369,10 @@ static void CheckMessages()
}
}

} else if( SDL_GetNumTouchFingers() == 2 ) {
} else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 2 ) {
second_finger_curr_x = ev.tfinger.x * WindowWidth;
second_finger_curr_y = ev.tfinger.y * WindowHeight;
} else if( SDL_GetNumTouchFingers() == 3 ) {
} else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 3 ) {
third_finger_curr_x = ev.tfinger.x * WindowWidth;
third_finger_curr_y = ev.tfinger.y * WindowHeight;
}
Expand All @@ -3381,7 +3381,7 @@ static void CheckMessages()
dbg( D_INFO ) << "Fingerdown triggered.";
dbg( D_INFO ) << "ev.tfinger.fingerId: " << ev.tfinger.fingerId;
dbg( D_INFO ) << "ev.tfinger.touchId: " << ev.tfinger.touchId;
if( SDL_GetNumTouchFingers() == 1 ) {
if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 1 ) {
finger_down_x = finger_curr_x = ev.tfinger.x * WindowWidth;
finger_down_y = finger_curr_y = ev.tfinger.y * WindowHeight;
finger_down_time = ticks;
Expand All @@ -3395,15 +3395,15 @@ static void CheckMessages()
}
ui_manager::redraw_invalidated();
needupdate = true; // ensure virtual joystick and quick shortcuts redraw as we interact
} else if( SDL_GetNumTouchFingers() == 2 ) {
} else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 2 ) {
if( !is_quick_shortcut_touch ) {
second_finger_down_x = second_finger_curr_x = ev.tfinger.x * WindowWidth;
second_finger_down_y = second_finger_curr_y = ev.tfinger.y * WindowHeight;
DebugLog( D_INFO, DC_ALL ) << "second_finger_curr_x: " << finger_down_x;
DebugLog( D_INFO, DC_ALL ) << "second_finger_curr_y: " << second_finger_curr_y;
is_two_finger_touch = true;
}
} else if( SDL_GetNumTouchFingers() == 3 ) {
} else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 3 ) {
if( !is_quick_shortcut_touch ) {
third_finger_down_x = third_finger_curr_x = ev.tfinger.x * WindowWidth;
third_finger_down_y = third_finger_curr_y = ev.tfinger.y * WindowHeight;
Expand All @@ -3416,7 +3416,7 @@ static void CheckMessages()
dbg( D_INFO ) << "Fingerup triggered.";
dbg( D_INFO ) << "ev.tfinger.fingerId: " << ev.tfinger.fingerId;
dbg( D_INFO ) << "ev.tfinger.touchId: " << ev.tfinger.touchId;
if( SDL_GetNumTouchFingers() == 1 ) {
if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 1 ) {
finger_curr_x = ev.tfinger.x * WindowWidth;
finger_curr_y = ev.tfinger.y * WindowHeight;
DebugLog( D_INFO, DC_ALL ) << "finger_curr_x: " << finger_curr_x;
Expand Down Expand Up @@ -3589,14 +3589,14 @@ static void CheckMessages()
needupdate = true; // ensure virtual joystick and quick shortcuts are updated properly
ui_manager::redraw_invalidated();
refresh_display(); // as above, but actually redraw it now as well
} else if( SDL_GetNumTouchFingers() == 2 ) {
} else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 2 ) {
if( is_two_finger_touch ) {
// on second finger release, just remember the x/y position so we can calculate delta once first finger is done
// is_two_finger_touch will be reset when first finger lifts (see above)
second_finger_curr_x = ev.tfinger.x * WindowWidth;
second_finger_curr_y = ev.tfinger.y * WindowHeight;
}
} else if( SDL_GetNumTouchFingers() == 3 ) {
} else if( SDL_GetNumTouchFingers(ev.tfinger.touchId) == 3 ) {
if( is_three_finger_touch ) {
// on third finger release, just remember the x/y position so we can calculate delta once first finger is done
// is_three_finger_touch will be reset when first finger lifts (see above)
Expand Down

0 comments on commit d34df6c

Please sign in to comment.