Struct andrew::shapes::rectangle::Rectangle[][src]

pub struct Rectangle {
    pub pos: (usize, usize),
    pub size: (usize, usize),
    pub border: Option<(usize, [u8; 4], Sides, Option<usize>)>,
    pub fill: Option<[u8; 4]>,
}
Expand description

A drawable object that represents a rectangle

Fields

pos: (usize, usize)

Position of the top-left corner of rectangle

size: (usize, usize)

The size of the rectangle to be drawn, the border will be contained within this size

border: Option<(usize, [u8; 4], Sides, Option<usize>)>

The border that is drawn around the perimeter of the rectangle. It’s arguments are thickness of border, color of border, sides that the border is drawn around, rounding size of the corners

fill: Option<[u8; 4]>

The color of the fill (area) of the rectangle

Implementations

Creates a new Rectangle object

Trait Implementations

A function that draws the object to a canvas

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.