godot/platform/javascript
Jamie Pate 562d7c616d 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)
(cherry picked from commit c2e3971013)
2022-08-24 17:16:33 +02:00
..
api [HTML5] Implement JavaScript PWA update callbacks. 2022-02-06 18:33:13 +01:00
export Refactor the export checking logic to improve separation of concerns 2022-08-14 08:47:09 -07:00
js Improve performance of screen_get_dpi() in Javascript 2022-08-24 17:16:33 +02:00
.eslintrc.engine.js [HTML5] Document Engine and EngineConfig (jsdoc). 2021-02-26 15:35:38 +01:00
.eslintrc.js HTML5: Fix minification error with Emscripten 1.39.9 2021-09-29 10:54:01 +02:00
.eslintrc.libs.js [HTML5] Refactor JS library listeners to OS. 2021-10-05 15:13:41 +02:00
README.md Add logo attribution for Android, HTML5 and Linux platform icons 2021-09-21 17:14:59 +02:00
SCsub [HTML5] Add GDNative+Threads build. 2022-06-13 11:46:08 +02:00
audio_driver_javascript.cpp Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
audio_driver_javascript.h Code quality: Fix header guards consistency 2022-07-25 14:53:37 +02:00
detect.py refactoring: simplify compiler version check 2022-06-17 10:08:49 +02:00
dom_keys.inc Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
emscripten_helpers.py [HTML5] Add GDNative+Threads build. 2022-06-13 11:46:08 +02:00
godot_audio.h Code quality: Fix header guards consistency 2022-07-25 14:53:37 +02:00
godot_js.h Merge pull request #61316 from bruvzg/tts_3x 2022-08-05 23:45:51 +02:00
godot_webgl2.cpp Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
godot_webgl2.h Code quality: Fix header guards consistency 2022-07-25 14:53:37 +02:00
http_client.h.inc Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
http_client_javascript.cpp [Net] Fix get_response_body_length for large files. 2022-01-25 18:23:04 +01:00
javascript_main.cpp Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
javascript_runtime.cpp Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
javascript_singleton.cpp [HTML5] Implement JavaScript PWA update callbacks. 2022-02-06 18:33:13 +01:00
logo.png Optimize images losslessly using `oxipng -o6 --strip all --zopfli` 2019-10-12 23:23:33 +02:00
os_javascript.cpp Merge pull request #63643 from aaronfranke/3.x-mouse-mode-ch 2022-08-08 14:36:45 +02:00
os_javascript.h Merge pull request #61316 from bruvzg/tts_3x 2022-08-05 23:45:51 +02:00
package-lock.json HTML5: Run `npm audit fix` 2022-05-25 14:59:03 +02:00
package.json HTML5: Run `npm audit fix` 2022-05-25 14:59:03 +02:00
platform_config.h Update copyright statements to 2022 2022-01-13 15:54:13 +01:00
run_icon.png
serve.json Add local web server configuration designed for web editor development 2022-01-25 18:23:39 +01:00

README.md

HTML5 platform port

This folder contains the C++ and JavaScript code for the HTML5/WebAssembly platform port, compiled using Emscripten.

It also contains a ESLint linting setup (see package.json).

See also misc/dist/html folder for files used by this platform such as the HTML5 shell.

Artwork license

logo.png and run_icon.png are licensed under Creative Commons Attribution 3.0 Unported per the HTML5 logo usage guidelines.