pub struct Arrow { /* private fields */ }Expand description
A single-outline arrow, with independent shaft and head geometry.
Implementations§
Source§impl Arrow
impl Arrow
Sourcepub fn new(from: Point, to: Point) -> Self
pub fn new(from: Point, to: Point) -> Self
Creates a width-one shaft and a ten-unit triangular head.
Sourcepub fn head_size(self, size: f64) -> Self
pub fn head_size(self, size: f64) -> Self
Sets head length and width; head length clamps to endpoint distance.
Sourcepub fn head_dimensions(self, length: f64, width: f64) -> Self
pub fn head_dimensions(self, length: f64, width: f64) -> Self
Sets independent positive head length and full width. Length clamps to endpoint distance; explicit width stays unchanged for a short arrow.
Sourcepub fn try_path(&self) -> Result<Path2D, ValidationError>
pub fn try_path(&self) -> Result<Path2D, ValidationError>
Returns a single filled arrow, an open Vee or shaft-only segment.
Trait Implementations§
Source§impl Shape for Arrow
impl Shape for Arrow
Source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
Geometric bounds; defaults to the path’s cached curve bounds.
Source§fn validate(&self) -> Result<(), ValidationError>
fn validate(&self) -> Result<(), ValidationError>
Reports retained authoring errors before measuring or drawing.
Source§fn as_rect(&self) -> Option<Rect>
fn as_rect(&self) -> Option<Rect>
Exact rectangle equivalent, when available, for a rule-independent fast path.
Auto Trait Implementations§
impl Forget for Arrow
impl Freeze for Arrow
impl RefUnwindSafe for Arrow
impl Send for Arrow
impl Sync for Arrow
impl Unpin for Arrow
impl UnsafeUnpin for Arrow
impl UnwindSafe for Arrow
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