Skip to main content

ZoomPan

Trait ZoomPan 

Source
pub trait ZoomPan {
    // Required methods
    fn view(&self) -> View;
    fn mapping(&self) -> Mapping;
    fn gesture(&mut self) -> &mut GestureState;
    fn change(&mut self, to: View, cause: Cause, phase: Phase) -> bool;

    // Provided methods
    fn signal(&mut self, phase: Phase, cause: Cause) { ... }
    fn leave(&mut self) { ... }
    fn double_click(
        &mut self,
        at: Pos2,
        default: &mut dyn FnMut() -> Option<View>,
    ) -> Option<View> { ... }
}
Expand description

A zoomable, pannable view the canvas gestures drive: its view and mapping this frame, and what it does with a change.

Required Methods§

Source

fn view(&self) -> View

The view shown now.

Source

fn mapping(&self) -> Mapping

The mapping of the view shown now.

Source

fn gesture(&mut self) -> &mut GestureState

The gestures’ memory between frames.

Source

fn change(&mut self, to: View, cause: Cause, phase: Phase) -> bool

Proposes a change; returns whether it was applied (a hook may refuse it). A Cancel is always applied.

Provided Methods§

Source

fn signal(&mut self, phase: Phase, cause: Cause)

A gesture begins or ends without a change of its own.

Source

fn leave(&mut self)

The profile’s “leave the view” (ViewAction::Leave).

Source

fn double_click( &mut self, at: Pos2, default: &mut dyn FnMut() -> Option<View>, ) -> Option<View>

A double click at at: the view it leads to. By default, the profile’s action (default); a hook may run it or not.

Implementors§