From 0f64589dba87a5dee70bdc624b6fbfaf02879bea Mon Sep 17 00:00:00 2001 From: dAxpeDDa Date: Wed, 26 Apr 2023 12:14:50 +0200 Subject: [PATCH] Don't change the internal canvas size --- CHANGELOG.md | 1 + src/platform_impl/web/web_sys/mod.rs | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e50ccab76..544a618776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ And please only add new entries to the top of this list, right below the `# Unre - On macOS, fix empty marked text blocking regular input. - On macOS, fix potential panic when getting refresh rate. - On macOS, fix crash when calling `Window::set_ime_position` from another thread. +- On Web, the canvas output bitmap size is no longer adjusted. # 0.28.3 diff --git a/src/platform_impl/web/web_sys/mod.rs b/src/platform_impl/web/web_sys/mod.rs index 8dc2531606..abfa1381ec 100644 --- a/src/platform_impl/web/web_sys/mod.rs +++ b/src/platform_impl/web/web_sys/mod.rs @@ -83,13 +83,8 @@ pub fn scale_factor() -> f64 { pub fn set_canvas_size(raw: &HtmlCanvasElement, size: Size) { let scale_factor = scale_factor(); - - let physical_size = size.to_physical::(scale_factor); let logical_size = size.to_logical::(scale_factor); - raw.set_width(physical_size.width); - raw.set_height(physical_size.height); - set_canvas_style_property(raw, "width", &format!("{}px", logical_size.width)); set_canvas_style_property(raw, "height", &format!("{}px", logical_size.height)); }