Floyd Wang 2025-03-29 11:02:15 +08:00 committed by GitHub
parent f86977e2a7
commit b4254a33e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 111 additions and 2 deletions

View file

@ -805,6 +805,21 @@ impl PlatformWindow for MacWindow {
self.0.as_ref().lock().content_size()
}
fn resize(&mut self, size: Size<Pixels>) {
let this = self.0.lock();
let window = this.native_window;
this.executor
.spawn(async move {
unsafe {
window.setContentSize_(NSSize {
width: size.width.0 as f64,
height: size.height.0 as f64,
});
}
})
.detach();
}
fn scale_factor(&self) -> f32 {
self.0.as_ref().lock().scale_factor()
}