mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Convert trait method to inherent method
This commit is contained in:
parent
21ea140339
commit
7940ec81d4
@ -9,9 +9,6 @@ pub trait Screen {
|
||||
/// The window
|
||||
type Window: HasDisplayHandle + HasWindowHandle + Send + Sync + 'static;
|
||||
|
||||
/// Access the size of the screen
|
||||
fn size(&self) -> ScreenSize;
|
||||
|
||||
/// Access the window
|
||||
fn window(&self) -> Arc<Self::Window>;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ use crate::{
|
||||
CameraTuningConfig, DEFAULT_CAMERA_TUNING_CONFIG, InputEvent,
|
||||
MouseButton,
|
||||
},
|
||||
screen::{NormalizedScreenPosition, Screen, ScreenSize},
|
||||
screen::{NormalizedScreenPosition, ScreenSize},
|
||||
window::Window,
|
||||
};
|
||||
|
||||
|
@ -44,12 +44,8 @@ impl Window {
|
||||
inner: Arc::new(window),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Screen for Window {
|
||||
type Window = winit::window::Window;
|
||||
|
||||
fn size(&self) -> ScreenSize {
|
||||
pub fn size(&self) -> ScreenSize {
|
||||
let size = self.inner.inner_size();
|
||||
|
||||
ScreenSize {
|
||||
@ -57,6 +53,10 @@ impl Screen for Window {
|
||||
height: size.height,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Screen for Window {
|
||||
type Window = winit::window::Window;
|
||||
|
||||
fn window(&self) -> Arc<Self::Window> {
|
||||
self.inner.clone()
|
||||
|
Loading…
Reference in New Issue
Block a user