pub struct RectF {
pub x1: f32,
pub x2: f32,
pub y1: f32,
pub y2: f32,
}
Expand description
Defines a rectangle with floating-point coordinates.
Fields§
§x1: f32
The X position of the first point (typically the left)
x2: f32
The X position of the second point (typically the right)
y1: f32
The Y position of the first point (typically the top)
y2: f32
The Y position of the second point (typically the bottom)
Implementations§
Source§impl RectF
impl RectF
Sourcepub fn with_size<T>(x: T, y: T, w: T, h: T) -> RectF
pub fn with_size<T>(x: T, y: T, w: T, h: T) -> RectF
Create a new rectangle, specifying X/Y Width/Height
Sourcepub fn with_exact<T>(x1: T, y1: T, x2: T, y2: T) -> RectF
pub fn with_exact<T>(x1: T, y1: T, x2: T, y2: T) -> RectF
Create a new rectangle, specifying exact dimensions
Sourcepub fn point_in_rect(&self, point: Vec2) -> bool
pub fn point_in_rect(&self, point: Vec2) -> bool
Returns true if a point is inside the rectangle
Trait Implementations§
impl Copy for RectF
impl StructuralPartialEq for RectF
Auto Trait Implementations§
impl Freeze for RectF
impl RefUnwindSafe for RectF
impl Send for RectF
impl Sync for RectF
impl Unpin for RectF
impl UnwindSafe for RectF
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