pub struct Navigation { /* private fields */ }Expand description
2-D viewport navigation session. Donor: oa::Navigation.
Implementations§
Sourcepub fn set_motion_speed(&mut self, speed: MotionSpeed)
pub fn set_motion_speed(&mut self, speed: MotionSpeed)
Apply the shared donor motion preset to subsequent viewport transitions.
pub fn new_with_config(config: NavigationConfig) -> Self
Sourcepub fn set_content_size(&mut self, w: f32, h: f32) -> Result<()>
pub fn set_content_size(&mut self, w: f32, h: f32) -> Result<()>
Set the content (source image) size.
Sourcepub fn set_viewport_size(&mut self, w: f32, h: f32) -> Result<()>
pub fn set_viewport_size(&mut self, w: f32, h: f32) -> Result<()>
Set the viewport (window) size.
pub fn pan_x(&self) -> f32
pub fn pan_y(&self) -> f32
pub fn zoom(&self) -> f32
Sourcepub fn fit_to_window(&mut self) -> Result<()>
pub fn fit_to_window(&mut self) -> Result<()>
Fit content to the viewport with no animation.
pub fn fit_to_window_animated(&mut self, animate: bool) -> Result<()>
Sourcepub fn zoom_to_100(&mut self)
pub fn zoom_to_100(&mut self)
Zoom to 1:1 pixel (100%).
Sourcepub fn keyboard_pan(&mut self, dir_x: f32, dir_y: f32)
pub fn keyboard_pan(&mut self, dir_x: f32, dir_y: f32)
Keyboard directional pan.
Sourcepub fn keyboard_zoom_in(&mut self)
pub fn keyboard_zoom_in(&mut self)
Keyboard zoom in.
Sourcepub fn keyboard_zoom_out(&mut self)
pub fn keyboard_zoom_out(&mut self)
Keyboard zoom out.
Sourcepub fn handle_event(&mut self, ev: &InputEvent) -> bool
pub fn handle_event(&mut self, ev: &InputEvent) -> bool
Route one InputEvent to the navigation logic.
Returns true when the event was consumed.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more