-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using SDL_RenderSetScale with sdl_sdlrenderer backend #6065
Comments
I have experienced this same issue this week as well, I just assumed it was a known limitation. If that fix works then that would be very useful to include. |
Ok. I'll make a PR in the next couple of days. |
Hello, thanks for opening the issue. No need for a PR if it is the same change. |
Thanks for update. (Maybe not the right place, but thanks for making and maintaining this awesome piece of software). |
I am not sure I understand this. Adding With this setup io.DisplaySize is the "half resolution" version (1 point = 1 imgui unit = 2 pixels). Your message however suggest the exact opposite thing. |
(This is in reference to commit 2efebe3) E.g. here it is without |
…play is correct on a Retina display (albeit lower-res as our other unmodified examples). (ocornut#6121, ocornut#6065, ocornut#5931).
Version/Branch of Dear ImGui:
Version: 1.89.2
Branch: master, commit d7c8516
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_sdl.cpp + imgui_impl_sdl_sdlrenderer.cpp
Compiler: Apple clang version 12.0.0 (clang-1200.0.32.29)
Operating System: macOS 10.15.7
My Issue/Question:
If
SDL_RenderSetScale
sets scale to anything other than 1, this ruins mouse coordinates.Standalone, minimal, complete and verifiable example:
insert
SDL_RenderSetScale(renderer, 2.0f, 2.0f);
after line 43 ofexample_sdl_sdlrenderer/main.cpp
.Partial solution
Following patch to imgui_impl_sdl.cpp restores correct mouse coordinates for purposes of clicking a button, but leaves window repositioning wrong.
UPDATE : Complete fix?
Following patch addresses both window movement and button clicking
The text was updated successfully, but these errors were encountered: