pub struct Visual {
pub key: String,
pub shape: Shape,
pub style: Style,
pub selectable: bool,
pub draggable: bool,
pub from_grab: bool,
}Expand description
Something an operation draws in the viewport, under a key the hit tests
report (see super::hit::hit_visuals) — and what the user can do with
it, which the editor handles alike for every operation (see
the step editor, crate::step_editor).
Fields§
§key: String§shape: Shape§style: Style§selectable: boolA click on it selects it, or takes it out of the selection again.
draggable: boolIt can be dragged in the plane worked in: the operation is sent
where to (see super::CanvasEvent::Move).
from_grab: boolEach event of a drag of it reaches the step as it was when it was grabbed, as a gizmo’s do: the operation applies the whole move, from where it was grabbed to where the pointer is, to that, and keeps no record of where the drag started. Without, it reaches the step as the drag’s last event left it.
Implementations§
Source§impl Visual
impl Visual
pub fn new(key: impl Into<String>, shape: Shape, style: Style) -> Self
pub fn selectable(self) -> Self
pub fn draggable(self) -> Self
Sourcepub fn draggable_from_grab(self) -> Self
pub fn draggable_from_grab(self) -> Self
Draggable, each event of a drag applied to the step as it was when
it was grabbed (see Visual::from_grab).