Don't change the internal canvas size
This commit is contained in:
parent
5438a2a524
commit
0f64589dba
2 changed files with 1 additions and 5 deletions
|
|
@ -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::<u32>(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, "height", &format!("{}px", logical_size.height));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue