Struct graphics::line::Line
[−]
[src]
pub struct Line { pub color: Color, pub radius: Radius, pub shape: Shape, }
A colored line with a default border radius
Fields
color | The line color |
radius | The line radius |
shape | The line shape |
Methods
impl Line
fn new(color: Color, radius: Radius) -> Line
Creates a new line
fn new_round(color: Color, radius: Radius) -> Line
Creates a new line
fn color(self, value: Color) -> Self
Sets color.
fn radius(self, value: Radius) -> Self
Sets radius.
fn width(self, value: Width) -> Self
Sets width.
fn shape(self, value: Shape) -> Self
Sets shape.
fn draw<L: Into<Line>, G>(&self, line: L, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics
Draw the line.
fn draw_arrow<L: Into<Line>, G>(&self, line: L, head_size: Scalar, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics
Draws an arrow
Head size is the sides of the triangle between the arrow hooks and the line