Merge pull request #43986 from Faless/js/3.x_em_fixes

[3.2] [HTML5] HiDPI, emscripten fixes
This commit is contained in:
Rémi Verschelde 2020-11-30 14:45:48 +01:00 committed by GitHub
commit 58ca8de52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -200,7 +200,7 @@ const GodotFS = {
}
FS.mkdirTree(dir);
}
FS.writeFile(path, new Uint8Array(buffer), { 'flags': 'wx+' });
FS.writeFile(path, new Uint8Array(buffer));
},
},
};

View File

@ -174,8 +174,8 @@ void OS_JavaScript::set_window_size(const Size2 p_size) {
window_maximized = false;
}
double scale = godot_js_display_pixel_ratio_get();
emscripten_set_canvas_element_size(canvas_id, p_size.x * scale, p_size.y * scale);
emscripten_set_element_css_size(canvas_id, p_size.x, p_size.y);
emscripten_set_canvas_element_size(canvas_id, p_size.x, p_size.y);
emscripten_set_element_css_size(canvas_id, p_size.x / scale, p_size.y / scale);
}
}