Refactor
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s

This commit is contained in:
Florian RICHER 2024-11-17 14:07:37 +01:00
parent e9ce480f96
commit 210a5504ab
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
6 changed files with 162 additions and 90 deletions

View file

@ -1,4 +1,5 @@
use std::ffi::c_char;
use winit::dpi::Pixel;
use winit::event_loop::ActiveEventLoop;
use winit::raw_window_handle::HasDisplayHandle;
@ -49,8 +50,10 @@ impl Window {
self.handle.as_ref()
}
pub fn size(&self) -> Option<winit::dpi::Size> {
self.window_attributes.inner_size
pub fn physical_size<P: Pixel>(&self) -> Option<winit::dpi::PhysicalSize<P>> {
self.window_attributes
.inner_size
.and_then(|size| Some(size.to_physical::<P>(1.0)))
}
pub fn request_redraw(&self) {