Fix screen_get_dpi on macOS for non fractional display scales and restore documentation.

This commit is contained in:
bruvzg 2020-10-01 22:52:20 +03:00
parent 25ca77c379
commit b0152dcac5
No known key found for this signature in database
GPG key ID: FCED35F1CECE0D3A
2 changed files with 22 additions and 3 deletions

View file

@ -521,6 +521,18 @@
<argument index="0" name="screen" type="int" default="-1">
</argument>
<description>
Returns the dots per inch density of the specified screen. If [code]screen[/code] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
[b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
[codeblock]
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
[/codeblock]
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
</description>
</method>
<method name="screen_get_max_scale" qualifiers="const">