Fixed DPI on MacBook Liquid retina screens#264
Merged
michaelsakharov merged 2 commits intoProwlEngine:New-Editorfrom Apr 27, 2026
Merged
Fixed DPI on MacBook Liquid retina screens#264michaelsakharov merged 2 commits intoProwlEngine:New-Editorfrom
michaelsakharov merged 2 commits intoProwlEngine:New-Editorfrom
Conversation
The root cause was that PreparePaperFrame was dividing Paper's resolution by ContentScale — on a 1x monitor cs=1 so this was a no-op and everything worked, but on Retina cs=2 so Paper's logical space was halved while the projection still covered the full 3024px framebuffer, leaving the UI crammed into the top-left quarter at half size.
Contributor
Author
|
Note: this was 100% done with claude code working with me to feed it debug logs to test different things until it figured it out. This is what claude said the root cause was after deliberating with it for awhile:
|
Contributor
Author
Contributor
|
Ill have to test it on my own monitors when I get back today. |
…indowContentScale glfwGetWindowContentScale returns the system DPI factor (e.g. 1.5) even when the process is DPI-unaware, where the OS virtualises the framebuffer so fbSize == winSize. The new PreparePaperFrame (resolution = winSize, scale = cs) then produced vertices spanning winSize × 1.5 > fbSize, pushing the UI off-screen on any Windows machine with DPI > 100%. The fb/win ratio is always the correct value: it measures actual pixel density from the app's coordinate perspective regardless of platform or DPI-awareness mode. On macOS the GLFW proc already failed and fell back to this ratio; now Windows uses the same path.
Contributor
Author
Contributor
Author
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.





This PR fixes DPI scaling issues for MacBook liquid retina screens.
Screenshot of MacBook DPI scaling now fixed:
Screenshot of external monitor which was working before and still works:
@sinnwrig @michaelsakharov @ZeppelinGames I need a PR review, if anyone could confirm that this doesn't break anything on your end?