Struct graphics::rectangle::Rectangle [] [src]

pub struct Rectangle {
    pub color: Color,
    pub shape: Shape,
    pub border: Option<Border>,
}

A filled rectangle

Fields

color

The rectangle color

shape

The roundness of the rectangle

border

The border

Methods

impl Rectangle

fn new(color: Color) -> Rectangle

Creates a new rectangle.

fn new_round(color: Color, round_radius: Radius) -> Rectangle

Creates a new round rectangle.

fn new_border(color: Color, radius: Radius) -> Rectangle

Creates a new rectangle border.

fn new_round_border(color: Color, round_radius: Radius, border_radius: Radius) -> Rectangle

Creates a new round rectangle border.

fn color(self, value: Color) -> Self

Sets color.

fn shape(self, value: Shape) -> Self

Sets shape.

fn border(self, value: Border) -> Self

Sets border.

fn maybe_border(self, value: Option<Border>) -> Self

Sets optional border.

fn draw<R: Into<Rectangle>, G>(&self, rectangle: R, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics

Draws the rectangle using default method.

fn draw_tri<R: Into<Rectangle>, G>(&self, rectangle: R, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics

Draws the rectangle using triangulation.

Trait Implementations

impl Colored for Rectangle

fn mul_rgba(self, r: ColorComponent, g: ColorComponent, b: ColorComponent, a: ColorComponent) -> Self

fn hue_rad(self, angle: ColorComponent) -> Self

fn tint(self, f: ColorComponent) -> Self

fn shade(self, f: ColorComponent) -> Self

fn hue_deg(self, angle: ColorComponent) -> Self

Derived Implementations

impl Clone for Rectangle

fn clone(&self) -> Rectangle

1.0.0fn clone_from(&mut self, source: &Self)

impl Copy for Rectangle