[−][src]Struct draw::shape::LineBuilder
Helper object for building lines; provides a better syntax than building a Shape::Line
from scratch.
Example
use draw::shape::LineBuilder; use draw::{Position, Shape}; let mut line = LineBuilder::new(Position::new(0.0, 0.0)); line.line_to(Position{x: 50.0 ,y: 50.0 }); line.curve_to(Position::new(50.0, 50.0), Position::new(20.0, 30.0)); // Consume the builder, turn the line into a shape for use with the display list let shape: Shape = line.into();
Methods
impl LineBuilder
[src]
pub fn new(start: Position) -> LineBuilder
[src]
Create a new LineBuilder with start
as the origin
pub fn line_to(&mut self, point: Position)
[src]
Draw a straight line to point
pub fn curve_to(&mut self, point: Position, curve: Position)
[src]
Draw a curve to point
, with a single control point at curve
pub fn to_shape(self) -> Shape
[src]
Consume the LineBuilder, return a Shape::Line
Trait Implementations
impl From<LineBuilder> for Shape
[src]
fn from(line: LineBuilder) -> Shape
[src]
Auto Trait Implementations
impl Send for LineBuilder
impl Unpin for LineBuilder
impl Sync for LineBuilder
impl RefUnwindSafe for LineBuilder
impl UnwindSafe for LineBuilder
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,