mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-24 02:16:32 +11:00
[with_winit] Set the canvas size to thw winit Window's inner size
This prevents the scaling caused by the hardcoded canvas dimensions on high dpi platforms.
This commit is contained in:
parent
5543ad01fe
commit
4642fa024f
1 changed files with 3 additions and 2 deletions
|
@ -483,8 +483,9 @@ pub fn main() -> Result<()> {
|
||||||
let window = create_window(&event_loop);
|
let window = create_window(&event_loop);
|
||||||
// On wasm, append the canvas to the document body
|
// On wasm, append the canvas to the document body
|
||||||
let canvas = window.canvas();
|
let canvas = window.canvas();
|
||||||
canvas.set_width(1044);
|
let size = window.inner_size();
|
||||||
canvas.set_height(800);
|
canvas.set_width(size.width);
|
||||||
|
canvas.set_height(size.height);
|
||||||
web_sys::window()
|
web_sys::window()
|
||||||
.and_then(|win| win.document())
|
.and_then(|win| win.document())
|
||||||
.and_then(|doc| doc.body())
|
.and_then(|doc| doc.body())
|
||||||
|
|
Loading…
Add table
Reference in a new issue