mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
winit_mininal: support proper window resizing (#35691)
Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
0e85d9f30a
commit
31de9c1c21
1 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue