mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 13:50:05 -04:00
Don't change the internal canvas size
This commit is contained in:
@@ -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 empty marked text blocking regular input.
|
||||||
- On macOS, fix potential panic when getting refresh rate.
|
- On macOS, fix potential panic when getting refresh rate.
|
||||||
- On macOS, fix crash when calling `Window::set_ime_position` from another thread.
|
- 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
|
# 0.28.3
|
||||||
|
|
||||||
|
|||||||
@@ -83,13 +83,8 @@ pub fn scale_factor() -> f64 {
|
|||||||
|
|
||||||
pub fn set_canvas_size(raw: &HtmlCanvasElement, size: Size) {
|
pub fn set_canvas_size(raw: &HtmlCanvasElement, size: Size) {
|
||||||
let scale_factor = scale_factor();
|
let scale_factor = scale_factor();
|
||||||
|
|
||||||
let physical_size = size.to_physical::<u32>(scale_factor);
|
|
||||||
let logical_size = size.to_logical::<f64>(scale_factor);
|
let logical_size = size.to_logical::<f64>(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, "width", &format!("{}px", logical_size.width));
|
||||||
set_canvas_style_property(raw, "height", &format!("{}px", logical_size.height));
|
set_canvas_style_property(raw, "height", &format!("{}px", logical_size.height));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user