pub struct LtrbRect {
pub left: f64,
pub top: f64,
pub right: f64,
pub bottom: f64,
}Expand description
A rectangle stored as left/top/right/bottom edges.
Fields§
§left: f64§top: f64§right: f64§bottom: f64Implementations§
Source§impl LtrbRect
impl LtrbRect
pub const INFINITE: LtrbRect
pub const fn new(left: f64, top: f64, right: f64, bottom: f64) -> Self
pub fn from_rect(rc: Rect) -> Self
pub fn width(&self) -> f64
pub fn height(&self) -> f64
pub fn is_well_ordered(&self) -> bool
pub fn is_zero_size(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn null_if_zero_size(self) -> Option<LtrbRect>
pub fn intersect_or_null(&self, rect: LtrbRect) -> Option<LtrbRect>
pub fn intersect_or_empty(&self, rect: LtrbRect) -> LtrbRect
pub fn intersects(&self, rect: LtrbRect) -> bool
pub fn contains(&self, x: f64, y: f64) -> bool
pub fn to_rect(&self) -> Rect
pub fn inflate(&self, thickness: Thickness) -> LtrbRect
Sourcepub fn top_left(&self) -> Point
pub fn top_left(&self) -> Point
The axis-aligned bounding box of the rectangle transformed by
matrix.
pub fn top_right(&self) -> Point
pub fn bottom_left(&self) -> Point
pub fn bottom_right(&self) -> Point
pub fn transform_to_aabb(&self, matrix: Matrix) -> LtrbRect
Sourcepub fn full_union(
left: Option<LtrbRect>,
right: Option<LtrbRect>,
) -> Option<LtrbRect>
pub fn full_union( left: Option<LtrbRect>, right: Option<LtrbRect>, ) -> Option<LtrbRect>
The union of two optional rectangles, where None is the empty
set.
Sourcepub fn full_union_rect(
left: Option<LtrbRect>,
right: Option<Rect>,
) -> Option<LtrbRect>
pub fn full_union_rect( left: Option<LtrbRect>, right: Option<Rect>, ) -> Option<LtrbRect>
The union of an optional rectangle with an optional Rect, where
None is the empty set.
pub fn union(&self, rect: LtrbRect) -> LtrbRect
Sourcepub fn contains_rect(&self, rect: LtrbRect) -> bool
pub fn contains_rect(&self, rect: LtrbRect) -> bool
Whether the rectangle contains another one, edges included.
Trait Implementations§
impl Copy for LtrbRect
impl StructuralPartialEq for LtrbRect
Auto Trait Implementations§
impl Freeze for LtrbRect
impl RefUnwindSafe for LtrbRect
impl Send for LtrbRect
impl Sync for LtrbRect
impl Unpin for LtrbRect
impl UnsafeUnpin for LtrbRect
impl UnwindSafe for LtrbRect
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more