pub struct RectF {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}Expand description
Um retângulo definido por origem e tamanho.
Fields§
§x: f32§y: f32§width: f32§height: f32Implementations§
Source§impl RectF
impl RectF
pub const ZERO: RectF
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self
pub fn right(&self) -> f32
pub fn bottom(&self) -> f32
pub fn origin(&self) -> PointF
pub fn size(&self) -> SizeF
pub fn center(&self) -> PointF
pub fn is_empty(&self) -> bool
pub fn contains(&self, p: PointF) -> bool
Sourcepub fn union(&self, other: RectF) -> RectF
pub fn union(&self, other: RectF) -> RectF
other cabe inteiro dentro deste.
Menor retângulo que contém os dois.
pub fn contains_rect(&self, other: RectF) -> bool
Sourcepub fn intersects(&self, other: RectF) -> bool
pub fn intersects(&self, other: RectF) -> bool
Os dois retângulos se sobrepõem.
Sourcepub fn from_points(a: PointF, b: PointF) -> Self
pub fn from_points(a: PointF, b: PointF) -> Self
Retângulo entre dois pontos, em qualquer ordem (seleção por área).
pub fn offset(self, dx: f32, dy: f32) -> Self
Sourcepub fn inflate(self, d: f32) -> Self
pub fn inflate(self, d: f32) -> Self
Aumenta (ou diminui, com valor negativo) o retângulo em todos os lados.
Sourcepub fn deflate(self, b: Bounds) -> Self
pub fn deflate(self, b: Bounds) -> Self
Retira as bordas dadas (como aplicar um padding). Nunca fica com tamanho negativo.
pub fn intersect(self, other: RectF) -> Option<RectF>
Trait Implementations§
impl Copy for RectF
impl StructuralPartialEq for RectF
Auto Trait Implementations§
impl Forget for RectF
impl Freeze for RectF
impl Move for RectF
impl RefUnwindSafe for RectF
impl Send for RectF
impl Sync for RectF
impl Unpin for RectF
impl UnsafeUnpin 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