Add Emscripten patches

This commit is contained in:
Christian Semmler 2025-07-11 16:35:10 -07:00
parent 08b029f4fa
commit d91cff37ab
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C

View File

@ -1,3 +1,28 @@
diff --git a/src/lib/libhtml5.js b/src/lib/libhtml5.js
index da08765e7..24e5da22e 100644
--- a/src/lib/libhtml5.js
+++ b/src/lib/libhtml5.js
@@ -1182,6 +1182,7 @@ var LibraryHTML5 = {
$registerRestoreOldStyle__deps: ['$getCanvasElementSize', '$setCanvasElementSize', '$currentFullscreenStrategy'],
$registerRestoreOldStyle: (canvas) => {
+ return;
var canvasSize = getCanvasElementSize(canvas);
var oldWidth = canvasSize[0];
var oldHeight = canvasSize[1];
@@ -1326,9 +1327,9 @@ var LibraryHTML5 = {
var topMargin;
if (inAspectRatioFixedFullscreenMode) {
- if (w*y < x*h) h = (w * y / x) | 0;
- else if (w*y > x*h) w = (h * x / y) | 0;
- topMargin = ((screenHeight - h) / 2) | 0;
+ if (w*y < x*h) h = Math.round(w * y / x) | 0;
+ else if (w*y > x*h) w = Math.round(h * x / y) | 0;
+ topMargin = Math.round((screenHeight - h) / 2) | 0;
}
if (inPixelPerfectFullscreenMode) {
diff --git a/src/lib/libpthread.js b/src/lib/libpthread.js
index 6d979627e..97e3f8684 100644
--- a/src/lib/libpthread.js