Skip to main content

CanvasEvent

Enum CanvasEvent 

Source
pub enum CanvasEvent {
    Hover {
        pointer: Pointer,
        shift: bool,
    },
    Leave,
    Click {
        pointer: Pointer,
        double: bool,
        shift: bool,
    },
    Cancel,
    Confirm,
    Delete,
    Move {
        key: String,
        from: Vector3,
        to: Vector3,
        pointer: Pointer,
        done: bool,
        shift: bool,
    },
    Stroke {
        from: Pointer,
        to: Pointer,
        done: bool,
        shift: bool,
    },
    Gizmo {
        drag: GizmoDrag,
        from: Gizmo,
        done: bool,
    },
    SelectBox {
        corners: [Pointer; 4],
        crossing: bool,
        add: bool,
    },
    Key {
        key: String,
    },
    View {
        up: Vector3,
    },
}
Expand description

A pointer or key event the editor passes on to an operation, having taken what is its own: picks, selecting, dragging handles (see the step editor, crate::step_editor).

Variants§

§

Hover

The pointer moved over the viewport with no button held, shift held or not.

Fields

§pointer: Pointer
§shift: bool
§

Leave

The pointer left the viewport.

§

Click

A primary click that selected nothing: a double one, one while the operation has a tool in hand, one on nothing selectable.

Fields

§pointer: Pointer
§double: bool
§shift: bool
§

Cancel

What Escape does: end what is in progress — a chain being drawn, the points picked for a tool — and, with nothing in progress, put the tool in hand down. The selection is cleared already.

§

Confirm

What Enter does: finish what is in progress, a chain being drawn, a constraint to apply; the tool stays in hand.

§

Delete

What Delete and Backspace do: delete the selection.

§

Move

The draggable visual key dragged in the plane worked in, from where it was grabbed to where the pointer is now — pointer, with shift held or not. done on release.

Fields

§from: Vector3
§pointer: Pointer
§done: bool
§shift: bool
§

Stroke

A drag of the tool in hand, where it strokes (see super::InHand::Strokes): the ray where it went down and the ray where the pointer is now. done on release.

Fields

§from: Pointer
§done: bool
§shift: bool
§

Gizmo

A drag of the form’s gizmo (see super::Gizmo): what it did since it started, to apply to the step’s arguments as they were then — which they are again whenever this is sent. done on release. from is the gizmo as the step asked for it when the drag started: where it stood, along what it stands on’s own axes.

Fields

§from: Gizmo
§done: bool
§

SelectBox

A selection box, with nothing in hand (see StepEditEvent::SelectBox): what it takes of the selectable visuals is the operation’s to decide, from what they stand for, and to select — added to the selection, if add.

Fields

§corners: [Pointer; 4]
§crossing: bool
§add: bool
§

Key

Any other key, as the browser names it, a letter lowercased: a tool’s shortcut.

Fields

§

View

The view settled, up pointing up the screen (see StepEditEvent::View).

Fields

Trait Implementations§

Source§

impl Clone for CanvasEvent

Source§

fn clone(&self) -> CanvasEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CanvasEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CanvasEvent

Source§

fn eq(&self, other: &CanvasEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CanvasEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.