Fix mouse behaviour when zoom is active

This commit is contained in:
Bad Diode 2022-10-13 18:20:24 +02:00
parent 3f90241e3b
commit 96e8dff73a
1 changed files with 2 additions and 2 deletions

View File

@ -118,10 +118,10 @@ poll_mouse(void) {
if (mouse_event.type == EV_REL) {
if (mouse_event.code == REL_X) {
in.mouse.x = CLAMP(
in.mouse.x / (s32)zoom + (s32)mouse_event.value, 0, (s32)screen_width);
in.mouse.x + (s32)mouse_event.value, 0, (s32)screen_width);
} else if (mouse_event.code == REL_Y) {
in.mouse.y = CLAMP(
in.mouse.y / (s32)zoom + (s32)mouse_event.value, 0, (s32)screen_height);
in.mouse.y + (s32)mouse_event.value, 0, (s32)screen_height);
}
} else if (mouse_event.type == EV_ABS) {
if (mouse_event.code == ABS_X) {