[−]Struct druid::kurbo::Line
A single line.
Fields
p0: Point
The line's start point.
p1: Point
The line's end point.
Implementations
impl Line
pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> Line
Create a new line.
pub fn length(self) -> f64
The length of the line.
Trait Implementations
impl Add<Vec2> for Line
type Output = Line
The resulting type after applying the +
operator.
pub fn add(self, v: Vec2) -> Line
impl Clone for Line
pub fn clone(&self) -> Line
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Line
impl Data for Line
[src]
impl Debug for Line
impl From<Line> for PathSeg
impl Mul<Line> for Affine
type Output = Line
The resulting type after applying the *
operator.
pub fn mul(self, other: Line) -> Line
impl Mul<Line> for TranslateScale
type Output = Line
The resulting type after applying the *
operator.
pub fn mul(self, other: Line) -> Line
impl ParamCurve for Line
pub fn eval(&self, t: f64) -> Point
pub fn start(&self) -> Point
pub fn end(&self) -> Point
pub fn subsegment(&self, range: Range<f64>) -> Line
pub fn subdivide(&self) -> (Self, Self)
impl ParamCurveArclen for Line
pub fn arclen(&self, _accuracy: f64) -> f64
pub fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
impl ParamCurveArea for Line
pub fn signed_area(&self) -> f64
impl ParamCurveCurvature for Line
impl ParamCurveDeriv for Line
type DerivResult = ConstPoint
The parametric curve obtained by taking the derivative of this one.
pub fn deriv(&self) -> ConstPoint
pub fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
impl ParamCurveExtrema for Line
pub fn extrema(&self) -> ArrayVec<[f64; 4]>
pub fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
pub fn bounding_box(&self) -> Rect
impl ParamCurveNearest for Line
impl PartialEq<Line> for Line
impl Scalable for Line
[src]
pub fn to_px(&self, scale: Scale) -> Line
[src]
Converts a Line
from display points into pixels,
using the x axis scale factor for x
and the y axis scale factor for y
.
pub fn to_dp(&self, scale: Scale) -> Line
[src]
Converts a Line
from pixels into display points,
using the x axis scale factor for x
and the y axis scale factor for y
.
impl Shape for Line
type PathElementsIter = LinePathIter
The iterator returned by the path_elements
method. Read more
pub fn path_elements(&self, _tolerance: f64) -> LinePathIter
pub fn area(&self) -> f64
Returning zero here is consistent with the contract (area is only meaningful for closed shapes), but an argument can be made that the contract should be tightened to include the Green's theorem contribution.
pub fn perimeter(&self, _accuracy: f64) -> f64
pub fn winding(&self, _pt: Point) -> i32
Same consideration as area
.
pub fn bounding_box(&self) -> Rect
pub fn as_line(&self) -> Option<Line>
pub fn to_path(&self, tolerance: f64) -> BezPath
pub fn into_path(self, tolerance: f64) -> BezPath
pub fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter>ⓘ
pub fn contains(&self, pt: Point) -> bool
pub fn as_rect(&self) -> Option<Rect>
pub fn as_rounded_rect(&self) -> Option<RoundedRect>
pub fn as_circle(&self) -> Option<Circle>
pub fn as_path_slice(&self) -> Option<&[PathEl]>
impl StructuralPartialEq for Line
impl Sub<Vec2> for Line
Auto Trait Implementations
impl RefUnwindSafe for Line
[src]
impl Send for Line
[src]
impl Sync for Line
[src]
impl Unpin for Line
[src]
impl UnwindSafe for Line
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: PartialEq<T> + Any,
[src]
T: PartialEq<T> + Any,
pub fn equals(&self, other: &(dyn Any + 'static)) -> bool
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,