godot/platform/javascript/js
Jamie Pate c2e3971013 Improve performance of screen_get_dpi() in Javascript
Replace a bisect with a single multiplication when calling
screen_get_dpi() in Javascript

Tested the value of
window.matchMedia(`(resolution:${(window.devicePixelRatio*96).toFixed(100)}dpi)`).matches
which is true except for values that cause a lot of rounding errors
(e.g. dpr : 0.3  => resolution: 28.799999999999997dpi)

Even in these cases the value matches the result of the previous
`findDPI()` method.

See also:

6cff589b5b (r81273660)
2022-08-15 21:12:19 -07:00
..
engine HTML5: Make OS.get_locale() match other platforms 2022-07-15 22:11:39 +03:00
jsdoc2rst [HTML5] Add jsdoc2rst tool. 2021-02-26 11:33:59 +01:00
libs Improve performance of screen_get_dpi() in Javascript 2022-08-15 21:12:19 -07:00