mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-08 03:48:27 +00:00
Inline redundant function
This commit is contained in:
parent
f789c09ef7
commit
28a4428c88
@ -100,7 +100,10 @@ impl ViewerWindow {
|
||||
|
||||
/// # Handle a cursor movement
|
||||
pub fn on_cursor_movement(&mut self, [x, y]: [f64; 2]) {
|
||||
let [width, height] = self.window.size().as_f64();
|
||||
let [width, height]: [f64; 2] = {
|
||||
let size = self.window.size();
|
||||
[size.width, size.height].map(Into::into)
|
||||
};
|
||||
let aspect_ratio = width / height;
|
||||
|
||||
// Cursor position in normalized coordinates (-1 to +1) with aspect
|
||||
|
@ -47,9 +47,4 @@ impl WindowSize {
|
||||
pub fn is_valid(&self) -> bool {
|
||||
self.width > 0 && self.height > 0
|
||||
}
|
||||
|
||||
/// Convert size to `f64`
|
||||
pub fn as_f64(&self) -> [f64; 2] {
|
||||
[self.width, self.height].map(Into::into)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user