Use Size in both Resize and FetchSize window actions

This commit is contained in:
Héctor Ramón Jiménez 2023-07-06 06:41:28 +02:00
parent b394c84b37
commit cc32bd4de0
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 15 additions and 18 deletions

View file

@ -741,17 +741,20 @@ pub fn run_command<A, E>(
window::Action::Drag => {
let _res = window.drag_window();
}
window::Action::Resize { width, height } => {
window::Action::Resize(size) => {
window.set_inner_size(winit::dpi::LogicalSize {
width,
height,
width: size.width,
height: size.height,
});
}
window::Action::FetchSize(callback) => {
let size = window.inner_size();
proxy
.send_event(callback((size.width, size.height)))
.send_event(callback(Size::new(
size.width,
size.height,
)))
.expect("Send message to event loop")
}
window::Action::Maximize(maximized) => {