pub struct DrawingState {
pub active_tool: Option<DrawingToolType>,
pub sel_drawing: Option<usize>,
pub magnet_mode: bool,
pub stay_in_drawing_mode: bool,
pub curr_color: Option<[u8; 4]>,
pub eraser_mode: bool,
}Expand description
Snapshot of drawing-related state from the central application state.
This struct is passed to DrawingManager::sync_from_app_state at the start
of each frame to ensure the manager stays in sync with toolbar selections,
keyboard shortcuts, and other UI actions that modify drawing state.
Fields§
§active_tool: Option<DrawingToolType>Currently selected drawing tool. None means selection/pointer mode.
sel_drawing: Option<usize>ID of the currently selected (highlighted) drawing on the chart.
magnet_mode: boolWhether magnet mode is enabled (snap to OHLC prices and existing drawing points).
stay_in_drawing_mode: boolWhether to stay in drawing mode after completing a drawing (lock mode).
curr_color: Option<[u8; 4]>Line colour every new drawing takes instead of its tool’s own, as RGBA bytes; None
keeps each tool’s default.
eraser_mode: boolWhether eraser mode is active (click to delete drawings).
Trait Implementations§
Source§impl Clone for DrawingState
impl Clone for DrawingState
Source§fn clone(&self) -> DrawingState
fn clone(&self) -> DrawingState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DrawingState
impl Debug for DrawingState
Source§impl Default for DrawingState
impl Default for DrawingState
Source§fn default() -> DrawingState
fn default() -> DrawingState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DrawingState
impl RefUnwindSafe for DrawingState
impl Send for DrawingState
impl Sync for DrawingState
impl Unpin for DrawingState
impl UnsafeUnpin for DrawingState
impl UnwindSafe for DrawingState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more