mirror of
https://github.com/encounter/aurora.git
synced 2025-07-05 20:56:08 +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 {
|
void process_event(const SDL_Event& event) noexcept {
|
||||||
if (event.type == SDL_EVENT_MOUSE_MOTION) {
|
if (event.type == SDL_EVENT_MOUSE_MOTION) {
|
||||||
SDL_Event scaledEvent = event;
|
SDL_Event scaledEvent = event;
|
||||||
scaledEvent.motion.x *= g_scale;
|
const auto density = SDL_GetWindowPixelDensity(window::get_sdl_window());
|
||||||
scaledEvent.motion.y *= g_scale;
|
scaledEvent.motion.x *= density;
|
||||||
scaledEvent.motion.xrel *= g_scale;
|
scaledEvent.motion.y *= density;
|
||||||
scaledEvent.motion.yrel *= g_scale;
|
scaledEvent.motion.xrel *= density;
|
||||||
|
scaledEvent.motion.yrel *= density;
|
||||||
ImGui_ImplSDL3_ProcessEvent(&scaledEvent);
|
ImGui_ImplSDL3_ProcessEvent(&scaledEvent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user