Skip to content

Commit

Permalink
Add window camera handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
antonylsg committed Oct 1, 2020
1 parent 3d3c7c1 commit b70ea2c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/window/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
/*
* FIXME: this file is too big. Some heavy refactoring need to be done here.
*/
use std::cell::Ref;
use std::cell::RefCell;
use std::cell::RefMut;
use std::iter::repeat;
use std::path::Path;
use std::rc::Rc;
Expand Down Expand Up @@ -631,6 +633,16 @@ impl Window {
self.canvas.cursor_pos()
}

/// Gets a handle to the window camera.
pub fn camera(&self) -> Ref<'_, ArcBall> {
self.camera.borrow()
}

/// Gets a mutable handle to the window camera.
pub fn camera_mut(&self) -> RefMut<'_, ArcBall> {
self.camera.borrow_mut()
}

#[inline]
fn handle_events(
&mut self,
Expand Down

0 comments on commit b70ea2c

Please sign in to comment.