fix: correct hidpi rendering on macos#16
Open
53053 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
edit: it seems this project may be inactive at the moment, though this patch has been working correctly in my own use so i’ll keep the PR up in case it helps someone else.
there are also some forks like yigithanyigit/lldbg that appear to include additional fixes and improvements.
if development resumes here in the future, i’d still be glad to help and contribute 🙂
fix: correct retina/hidpi rendering on macos
details
Fixes blurry rendering on retina/high-dpi displays by consistently separating logical window coordinates from physical framebuffer sizes.
Fonts are now scaled using the window content scale, glviewport uses framebuffer dimensions, and resize/layout calculations stay in logical coordinates as expected by imgui.
should be effectively a no-op on 1x displays, tested mainly on macos retina.
screenshots
zoom-in anywhere to notice.
before (retina, 2x scale):
after:
tested on apple silicon, macos, 2x retina. imgui 1.90.9.
related
GLFW_COCOA_RETINA_FRAMEBUFFER, same fix patternglfwGetFramebufferSizeforglViewport: https://github.com/ocornut/imgui/blob/master/examples/example_glfw_opengl3/main.cpp