pub enum DrawingInteractionMode {
SingleClick,
ClickClick,
DragToDraw,
ContinuousDraw,
MultiPoint,
NotDrawing,
}Expand description
How a drawing tool captures points from mouse/pointer input.
Every DrawingToolType maps to exactly one
interaction mode via
DrawingToolType::interaction_mode().
The mode governs the full creation flow: how many clicks are needed, whether
dragging is involved, and when the drawing is marked as complete.
§Example
use egui_charts::config::{DrawingToolType, DrawingInteractionMode};
assert_eq!(
DrawingToolType::TrendLine.interaction_mode(),
DrawingInteractionMode::ClickClick,
);
assert_eq!(
DrawingToolType::Rect.interaction_mode(),
DrawingInteractionMode::DragToDraw,
);Variants§
SingleClick
Click once to place (e.g., HorizontalLine, TextLabel, arrow markers).
The drawing is created and completed with a single click. Only one
ChartPoint is captured.
ClickClick
Click to set the first point, move, then click to set the second point
(e.g., TrendLine, Ray, ExtendedLine).
A preview line follows the cursor between the first and second clicks.
DragToDraw
Press the mouse button to set the first point, drag to the second point,
and release to complete (e.g., Rect, Circle, FibonacciRetracement).
ContinuousDraw
Hold the mouse button and draw a freehand path; release to complete
(e.g., Brush, Highlighter).
Points are continuously appended while the button is held.
MultiPoint
Click to add points one at a time; double-click or press Enter to finish
(e.g., Polyline, XABCDPattern, ElliottImpulse).
The number of required points varies by tool (see
DrawingToolType::required_points()).
Some tools (like Polyline) have no fixed limit.
NotDrawing
Not a drawing tool – cursor/interaction modes only
(e.g., CrossCursor, Eraser).
These tools modify the cursor or provide utility functions but do not
create Drawing objects.
Trait Implementations§
Source§impl Clone for DrawingInteractionMode
impl Clone for DrawingInteractionMode
Source§fn clone(&self) -> DrawingInteractionMode
fn clone(&self) -> DrawingInteractionMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DrawingInteractionMode
Source§impl Debug for DrawingInteractionMode
impl Debug for DrawingInteractionMode
impl Eq for DrawingInteractionMode
Source§impl Hash for DrawingInteractionMode
impl Hash for DrawingInteractionMode
Source§impl PartialEq for DrawingInteractionMode
impl PartialEq for DrawingInteractionMode
impl StructuralPartialEq for DrawingInteractionMode
Auto Trait Implementations§
impl Freeze for DrawingInteractionMode
impl RefUnwindSafe for DrawingInteractionMode
impl Send for DrawingInteractionMode
impl Sync for DrawingInteractionMode
impl Unpin for DrawingInteractionMode
impl UnsafeUnpin for DrawingInteractionMode
impl UnwindSafe for DrawingInteractionMode
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
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
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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> ⓘ
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> ⓘ
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