ui: fix scroll increment for more consistency with default native windows behavior; linux_window_manager: make consistent with windows scroll events

This commit is contained in:
Ryan Fleury committed 2026-09-30 08:12:47 -07:00
1 parent be3fa56927
commit 7ee21690c2
2 files changed
+6 -3

No files matched your search

@@ -1328,12 +1328,15 @@ wm_get_events(Arena *arena, B32 wait)
e->pos = v2f32((F32)evt.xbutton.x, (F32)evt.xbutton.y);
}
else if(evt.xbutton.button == Button4 ||
evt.xbutton.button == Button5)
evt.xbutton.button == Button5 ||
evt.xbutton.button == 6 ||
evt.xbutton.button == 7)
{
WM_Event *e = wm_event_list_push_new(arena, &evts, WM_EventKind_Scroll);
e->window.u64[0] = (U64)window;
e->modifiers = modifiers;
e->delta = v2f32(0, evt.xbutton.button == Button4 ? -1.f : +1.f);
e->delta = v2f32(evt.xbutton.button == 6 ? -120.f : evt.xbutton.button == 7 ? +120.f : 0.f,
evt.xbutton.button == Button4 ? -120.f : evt.xbutton.button == Button5 ? +120.f : 0.f);
e->pos = v2f32((F32)evt.xbutton.x, (F32)evt.xbutton.y);
}
}
+1 -1
View File
@@ -2957,7 +2957,7 @@ ui_signal_from_box(UI_Box *box)
{
Swap(F32, delta.x, delta.y);
}
Vec2S16 delta16 = v2s16((S16)(delta.x/30.f), (S16)(delta.y/30.f));
Vec2S16 delta16 = v2s16((S16)(delta.x/40.f), (S16)(delta.y/40.f));
if(delta.x > 0 && delta16.x == 0) { delta16.x = +1; }
if(delta.x < 0 && delta16.x == 0) { delta16.x = -1; }
if(delta.y > 0 && delta16.y == 0) { delta16.y = +1; }