Commit fe2b85d
committed
Backends: Glfw, SDL2: ImplXXXGetContentScale shall return 1 on emscripten / apple / android
This is a fix related to #8733
We can divide platforms into two cases based on how they report screen geometry:
Case 1: Platforms which report screen size in "physical pixels": Windows (for "Dpi aware" apps), Linux (with Wayland)
Case 2: Platforms which report screen size in "density-independent pixels": macOS, iOS, Android, emscripten
As a consequence, there are two important things we need to know:
FramebufferScale: The scaling factor FrameBufferSize / ScreenSize
In case 1, the framebuffer size is equal to the screen size and DisplayFramebufferScale=1.
In case 2, the framebuffer size is equal to the screen size multiplied by a factor, for example DisplayFramebufferScale=2.
ContentScale The scaling factor for the content that we will display
In case 1, the content scale will often need to be > 1 (e.g., 2), because we will need to display bigger elements so that they show with a correct physical size on the screen.
In case 2, the content scale is equal to 1
This commit fixes ContentScale for platforms in case 2.1 parent 22ad62c commit fe2b85d
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
879 | | - | |
| 879 | + | |
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
891 | | - | |
| 891 | + | |
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
| 721 | + | |
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| |||
0 commit comments