anvil: Fix winit resizing

This commit is contained in:
Victor Brekenfeld 2022-01-10 19:31:07 +01:00
parent fefb287fa8
commit 51ece28120
1 changed files with 62 additions and 54 deletions

View File

@ -168,7 +168,14 @@ pub fn run_winit(log: Logger) {
.and_then(|_| {
backend
.renderer()
.render(size, Transform::Flipped180, |renderer, frame| {
.render(
output_geometry
.size
.to_f64()
.to_physical(output_scale as f64)
.to_i32_round(),
Transform::Flipped180,
|renderer, frame| {
render_layers_and_windows(
renderer,
frame,
@ -238,7 +245,8 @@ pub fn run_winit(log: Logger) {
}
Ok(())
})
},
)
.map_err(Into::<SwapBuffersError>::into)
.and_then(|x| x)
})