mirror of
https://github.com/hannobraun/Fornjot
synced 2025-09-08 02:16:31 +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
|
/// The window
|
||||||
type Window: HasDisplayHandle + HasWindowHandle + Send + Sync + 'static;
|
type Window: HasDisplayHandle + HasWindowHandle + Send + Sync + 'static;
|
||||||
|
|
||||||
/// Access the size of the screen
|
|
||||||
fn size(&self) -> ScreenSize;
|
|
||||||
|
|
||||||
/// Access the window
|
/// Access the window
|
||||||
fn window(&self) -> Arc<Self::Window>;
|
fn window(&self) -> Arc<Self::Window>;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ use crate::{
|
|||||||
CameraTuningConfig, DEFAULT_CAMERA_TUNING_CONFIG, InputEvent,
|
CameraTuningConfig, DEFAULT_CAMERA_TUNING_CONFIG, InputEvent,
|
||||||
MouseButton,
|
MouseButton,
|
||||||
},
|
},
|
||||||
screen::{NormalizedScreenPosition, Screen, ScreenSize},
|
screen::{NormalizedScreenPosition, ScreenSize},
|
||||||
window::Window,
|
window::Window,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,12 +44,8 @@ impl Window {
|
|||||||
inner: Arc::new(window),
|
inner: Arc::new(window),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl Screen for Window {
|
pub fn size(&self) -> ScreenSize {
|
||||||
type Window = winit::window::Window;
|
|
||||||
|
|
||||||
fn size(&self) -> ScreenSize {
|
|
||||||
let size = self.inner.inner_size();
|
let size = self.inner.inner_size();
|
||||||
|
|
||||||
ScreenSize {
|
ScreenSize {
|
||||||
@ -57,6 +53,10 @@ impl Screen for Window {
|
|||||||
height: size.height,
|
height: size.height,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Screen for Window {
|
||||||
|
type Window = winit::window::Window;
|
||||||
|
|
||||||
fn window(&self) -> Arc<Self::Window> {
|
fn window(&self) -> Arc<Self::Window> {
|
||||||
self.inner.clone()
|
self.inner.clone()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user