pub struct FRectangle {
pub position: FPosition,
pub size: FSize,
}Expand description
Represents a floating-point rectangle, using a position and size.
Fields§
§position: FPositionThe location of the rectangle’s upper-left corner
size: FSizeThe width and height of the rectangle
Implementations§
Source§impl FRectangle
impl FRectangle
Sourcepub fn new(position: FPosition, size: FSize) -> Self
pub fn new(position: FPosition, size: FSize) -> Self
Returns a new rectangle with the given position and size
§Panics
This function may panic if the width or height is < 0.
Sourcepub fn new_from_raw(x: f32, y: f32, width: f32, height: f32) -> Self
pub fn new_from_raw(x: f32, y: f32, width: f32, height: f32) -> Self
Returns a new rectangle with the given raw position and size values
§Panics
This function may panic if the width or height is < 0.
Sourcepub fn contains_position(&self, position: FPosition) -> bool
pub fn contains_position(&self, position: FPosition) -> bool
Returns whether a given position is within the rectangle or not
Trait Implementations§
Source§impl Clone for FRectangle
impl Clone for FRectangle
Source§fn clone(&self) -> FRectangle
fn clone(&self) -> FRectangle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FRectangle
impl Debug for FRectangle
Source§impl Default for FRectangle
impl Default for FRectangle
Source§fn default() -> FRectangle
fn default() -> FRectangle
Returns the “default value” for a type. Read more
Source§impl PartialEq for FRectangle
impl PartialEq for FRectangle
impl Copy for FRectangle
impl StructuralPartialEq for FRectangle
Auto Trait Implementations§
impl Freeze for FRectangle
impl RefUnwindSafe for FRectangle
impl Send for FRectangle
impl Sync for FRectangle
impl Unpin for FRectangle
impl UnwindSafe for FRectangle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more