pub struct LtrbPixelRect {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}Expand description
A pixel rectangle stored as left/top/right/bottom edges.
Fields§
§left: i32§top: i32§right: i32§bottom: i32Implementations§
Source§impl LtrbPixelRect
impl LtrbPixelRect
pub const fn new(left: i32, top: i32, right: i32, bottom: i32) -> Self
pub fn from_pixel_rect(rc: PixelRect) -> Self
pub fn width(&self) -> i32
pub fn height(&self) -> i32
pub fn is_empty(&self) -> bool
pub fn to_pixel_rect(&self) -> PixelRect
pub fn union(&self, rect: LtrbPixelRect) -> LtrbPixelRect
Sourcepub fn from_rect_with_dpi(rect: LtrbRect, scaling: f64) -> Self
pub fn from_rect_with_dpi(rect: LtrbRect, scaling: f64) -> Self
Converts a logical rectangle to the smallest pixel rectangle that contains it at the given scaling.
pub fn contains(&self, x: i32, y: i32) -> bool
pub fn to_rect_unscaled(&self) -> Rect
pub fn to_ltrb_rect_unscaled(&self) -> LtrbRect
pub fn from_rect_unscaled(rect: LtrbRect) -> Self
Trait Implementations§
Source§impl Clone for LtrbPixelRect
impl Clone for LtrbPixelRect
impl Copy for LtrbPixelRect
Source§impl Debug for LtrbPixelRect
impl Debug for LtrbPixelRect
Source§impl Default for LtrbPixelRect
impl Default for LtrbPixelRect
impl Eq for LtrbPixelRect
Source§impl Hash for LtrbPixelRect
impl Hash for LtrbPixelRect
Source§impl PartialEq for LtrbPixelRect
impl PartialEq for LtrbPixelRect
impl StructuralPartialEq for LtrbPixelRect
Auto Trait Implementations§
impl Freeze for LtrbPixelRect
impl RefUnwindSafe for LtrbPixelRect
impl Send for LtrbPixelRect
impl Sync for LtrbPixelRect
impl Unpin for LtrbPixelRect
impl UnsafeUnpin for LtrbPixelRect
impl UnwindSafe for LtrbPixelRect
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