Enable virtual finger only on left click

The pinch-to-zoom feature must only be enabled with Ctrl+left_click.
This commit is contained in:
Romain Vimont 2022-01-01 23:59:20 +01:00
parent 57f1655d4b
commit cca3c953da

View file

@ -783,8 +783,9 @@ input_manager_process_mouse_button(struct input_manager *im,
// In other words, the center of the rotation/scaling is the center of the // In other words, the center of the rotation/scaling is the center of the
// screen. // screen.
#define CTRL_PRESSED (SDL_GetModState() & (KMOD_LCTRL | KMOD_RCTRL)) #define CTRL_PRESSED (SDL_GetModState() & (KMOD_LCTRL | KMOD_RCTRL))
if ((down && !im->vfinger_down && CTRL_PRESSED) if (event->button == SDL_BUTTON_LEFT &&
|| (!down && im->vfinger_down)) { ((down && !im->vfinger_down && CTRL_PRESSED) ||
(!down && im->vfinger_down))) {
struct sc_point mouse = struct sc_point mouse =
screen_convert_window_to_frame_coords(im->screen, event->x, screen_convert_window_to_frame_coords(im->screen, event->x,
event->y); event->y);