Struct graphics_shapes::rect::Rect
source · pub struct Rect { /* private fields */ }Implementations§
source§impl Rect
impl Rect
sourcepub fn as_smallest_circle(&self) -> Circle
pub fn as_smallest_circle(&self) -> Circle
Create a circle around the center to the closest edge
sourcepub fn as_biggest_circle(&self) -> Circle
pub fn as_biggest_circle(&self) -> Circle
Create a circle around the center to the farthest edge
pub fn as_triangles(&self) -> (Triangle, Triangle)
pub fn as_polygon(&self) -> Polygon
pub fn as_ellipse(&self) -> Ellipse
Trait Implementations§
source§impl Shape for Rect
impl Shape for Rect
source§fn from_points(points: Vec<Coord>) -> Selfwhere
Self: Sized,
fn from_points(points: Vec<Coord>) -> Selfwhere
Self: Sized,
create this shape from a list of points
fn rotate_around<P: Into<Coord>>(&self, degrees: isize, point: P) -> Selfwhere
Self: Sized,
source§fn translate_by<P: Into<Coord>>(&self, delta: P) -> Selfwhere
Self: Sized,
fn translate_by<P: Into<Coord>>(&self, delta: P) -> Selfwhere
Self: Sized,
change every point by +
deltasource§fn move_to<P: Into<Coord>>(&self, point: P) -> Selfwhere
Self: Sized,
fn move_to<P: Into<Coord>>(&self, point: P) -> Selfwhere
Self: Sized,
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read more