mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-15 22:46:08 +00:00
Inline redundant function
This commit is contained in:
parent
000a9a52df
commit
5af1b5ab22
@ -177,7 +177,10 @@ impl ViewerWindow {
|
||||
|
||||
/// Draw the graphics
|
||||
pub fn draw(&mut self) {
|
||||
let size_is_valid = self.window.size().is_valid();
|
||||
let size_is_valid = {
|
||||
let size = self.window.size();
|
||||
size.width > 0 && size.height > 0
|
||||
};
|
||||
if !size_is_valid {
|
||||
return;
|
||||
}
|
||||
|
@ -38,13 +38,3 @@ pub struct WindowSize {
|
||||
/// The height of the screen
|
||||
pub height: u32,
|
||||
}
|
||||
|
||||
impl WindowSize {
|
||||
/// # Indicate whether the screen size is valid
|
||||
///
|
||||
/// A screen size is valid, if neither of its dimensions is zero. But it can
|
||||
/// be reported as zero by spurious screen resize events.
|
||||
pub fn is_valid(&self) -> bool {
|
||||
self.width > 0 && self.height > 0
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user