diff --git a/crates/fj-viewer/src/viewer.rs b/crates/fj-viewer/src/viewer.rs index c1e6bd3b8..9e0475504 100644 --- a/crates/fj-viewer/src/viewer.rs +++ b/crates/fj-viewer/src/viewer.rs @@ -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 diff --git a/crates/fj-viewer/src/window.rs b/crates/fj-viewer/src/window.rs index 05d346ee3..b3f9df366 100644 --- a/crates/fj-viewer/src/window.rs +++ b/crates/fj-viewer/src/window.rs @@ -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) - } }