Struct nannou::ui::prelude::widget::primitive::line::Line[][src]

pub struct Line {
    pub common: CommonBuilder,
    pub start: [f64; 2],
    pub end: [f64; 2],
    pub style: Style,
    pub should_centre_points: bool,
}

A simple, non-interactive widget for drawing a single straight Line.

Fields

common: CommonBuilder

Data necessary and common for all widget builder types.

start: [f64; 2]

The start of the line.

end: [f64; 2]

The end of the line.

style: Style

Unique styling.

should_centre_points: bool

Whether or not the line should be automatically centred to the widget position.

Implementations

impl Line[src]

pub fn styled(start: [f64; 2], end: [f64; 2], style: Style) -> Line[src]

Build a new Line widget with the given style.

pub fn new(start: [f64; 2], end: [f64; 2]) -> Line[src]

Build a new default Line widget.

pub fn abs(start: [f64; 2], end: [f64; 2]) -> Line[src]

Build a new Line whose bounding box is fit to the absolute co-ordinates of the line points.

If you would rather centre the start and end to the middle of the bounding box, use Line::centred instead.

pub fn abs_styled(start: [f64; 2], end: [f64; 2], style: Style) -> Line[src]

The same as Line::abs but with the given style.

pub fn centred(start: [f64; 2], end: [f64; 2]) -> Line[src]

Build a new Line and shift the location of the start and end points so that the centre of their bounding rectangle lies at the position determined by the layout for the Line widget.

This is useful if your points simply describe the line’s angle and magnitude, and you want to position them using conrod’s auto-layout or Positionable methods.

If you would rather centre the bounding box to the points, use Line::abs instead.

pub fn centred_styled(start: [f64; 2], end: [f64; 2], style: Style) -> Line[src]

The same as Line::centred but with the given style.

pub fn thickness(self, thickness: f64) -> Line[src]

The thickness or width of the Line.

Use this instead of Positionable::width for the thickness of the Line, as width and height refer to the dimensions of the bounding rectangle.

pub fn solid(self) -> Line[src]

Make a solid line.

pub fn dashed(self) -> Line[src]

Make a line with a Dashed pattern.

pub fn dotted(self) -> Line[src]

Make a line with a Dotted pattern.

Trait Implementations

impl Clone for Line[src]

impl Colorable for Line[src]

impl Common for Line[src]

impl Copy for Line[src]

impl Debug for Line[src]

impl Widget for Line[src]

type State = State

State to be stored within the Uis widget cache. Read more

type Style = Style

Every widget is required to have its own associated Style type. This type is intended to contain high-level styling information for the widget that can be optionally specified by a user of the widget. Read more

type Event = ()

The type of event yielded by the widget, returned via the Widget::set function. Read more

pub fn update(
    self,
    args: UpdateArgs<'_, '_, '_, '_, Line>
) -> <Line as Widget>::Event
[src]

Update the state of the Line.

Auto Trait Implementations

impl RefUnwindSafe for Line

impl Send for Line

impl Sync for Line

impl Unpin for Line

impl UnwindSafe for Line

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> Downcast<T> for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<W> Positionable for W where
    W: Widget
[src]

impl<T> SetParameter for T

impl<W> Sizeable for W where
    W: Widget
[src]

pub fn get_x_dimension(&self, ui: &Ui) -> Dimension[src]

We attempt to retrieve the x Dimension for the widget via the following:

  • Check for specified value at maybe_x_dimension
  • Otherwise, use the default returned by Widget::default_x_dimension.

pub fn get_y_dimension(&self, ui: &Ui) -> Dimension[src]

We attempt to retrieve the y Dimension for the widget via the following:

  • Check for specified value at maybe_y_dimension
  • Otherwise, use the default returned by Widget::default_y_dimension.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,