Struct flo_animation::Rect
[−]
[src]
pub struct Rect { pub x1: f32, pub y1: f32, pub x2: f32, pub y2: f32, }
Represents a rectangle
Fields
x1: f32
y1: f32
x2: f32
y2: f32
Methods
impl Rect
[src]
pub fn new(top_left: PathPoint, bottom_right: PathPoint) -> Rect
[src]
Creates a new rectangle
pub fn with_points(x1: f32, y1: f32, x2: f32, y2: f32) -> Rect
[src]
Creates a new rectangle with specific points
pub fn empty() -> Rect
[src]
Creates an empty rectangle
pub fn normalize(self) -> Rect
[src]
Converts a rectangle into one where x2 and y2 are greater than x1 and y1
pub fn contains(&self, x: f32, y: f32) -> bool
[src]
Returns true if the specified point is inside this rectangle
pub fn is_zero_size(&self) -> bool
[src]
True if this rectangle has no size
pub fn union(self, rhs: Rect) -> Rect
[src]
Creates the union of two rectangles
Trait Implementations
impl From<(PathPoint, PathElement)> for Rect
[src]
An element and its starting point can be converted into a bounding rectangle
impl From<(PathElement, PathElement)> for Rect
[src]
Pairs of path elements can also be turned into bounding rectangles
fn from((previous, next): (PathElement, PathElement)) -> Rect
[src]
Performs the conversion.
impl<'a> From<&'a Path> for Rect
[src]
Paths can be converted into bounding boxes
impl From<Path> for Rect
[src]
impl Copy for Rect
[src]
impl Clone for Rect
[src]
fn clone(&self) -> Rect
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Rect
[src]
fn eq(&self, __arg_0: &Rect) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rect) -> bool
[src]
This method tests for !=
.
impl Debug for Rect
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more