mirror of
https://github.com/encounter/aurora.git
synced 2025-07-05 04:35:55 +00:00
Fix mouse scaling on hi-dpi displays and xorg/windows
This commit is contained in:
parent
f058c5b7a5
commit
09f8c676ec
@ -71,10 +71,11 @@ void shutdown() noexcept {
|
||||
void process_event(const SDL_Event& event) noexcept {
|
||||
if (event.type == SDL_EVENT_MOUSE_MOTION) {
|
||||
SDL_Event scaledEvent = event;
|
||||
scaledEvent.motion.x *= g_scale;
|
||||
scaledEvent.motion.y *= g_scale;
|
||||
scaledEvent.motion.xrel *= g_scale;
|
||||
scaledEvent.motion.yrel *= g_scale;
|
||||
const auto density = SDL_GetWindowPixelDensity(window::get_sdl_window());
|
||||
scaledEvent.motion.x *= density;
|
||||
scaledEvent.motion.y *= density;
|
||||
scaledEvent.motion.xrel *= density;
|
||||
scaledEvent.motion.yrel *= density;
|
||||
ImGui_ImplSDL3_ProcessEvent(&scaledEvent);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user