Fix for pen proximity put as an option

This commit is contained in:
Yousef Khadadeh 2025-07-08 15:12:35 +03:00
parent c5f7cd236e
commit 6cf6789f70
3 changed files with 27 additions and 4 deletions

View file

@ -613,8 +613,12 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {
break;
case SDL_EVENT_MOUSE_MOTION:
mS.m->window.scale = SDL_GetWindowPixelDensity(mS.window);
if(!mS.m->input.pen.inProximity)
mS.m->input.mouse.set_pos({event->motion.x * mS.m->window.scale, event->motion.y * mS.m->window.scale});
#ifdef _WIN32
if(!mS.m->toolbar.tabletOptions.ignoreMouseMovementWhenPenInProximity || !mS.m->input.pen.inProximity)
#endif
{
mS.m->input.mouse.set_pos({event->motion.x * mS.m->window.scale, event->motion.y * mS.m->window.scale});
}
break;
case SDL_EVENT_MOUSE_BUTTON_UP:
if(event->button.button == 1)
@ -675,8 +679,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {
}
case SDL_EVENT_PEN_MOTION: {
mS.m->input.pen.isEraser = event->pmotion.pen_state & SDL_PEN_INPUT_ERASER_TIP;
if(mS.m->input.pen.inProximity)
mS.m->input.mouse.set_pos({event->pmotion.x, event->pmotion.y});
mS.m->input.mouse.set_pos({event->pmotion.x, event->pmotion.y});
break;
}
case SDL_EVENT_PEN_DOWN: {