winit_mininal: support proper window resizing (#35691)

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-02-27 06:59:35 -08:00 committed by GitHub
parent 0e85d9f30a
commit 31de9c1c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -184,6 +184,16 @@ impl ApplicationHandler<WakerEvent> for App {
}
}
},
WindowEvent::Resized(new_size) => {
if let Self::Running(state) = self {
if let Some(webview) = state.webviews.borrow().last() {
let mut rect = webview.rect();
rect.set_size(winit_size_to_euclid_size(new_size).to_f32());
webview.move_resize(rect);
webview.resize(new_size);
}
}
},
_ => (),
}
}