pub struct Xyhw { /* private fields */ }
Expand description
Struct containing min/max width and height and window placement. x,y from top left.
Implementations§
Source§impl Xyhw
impl Xyhw
pub const fn x(&self) -> i32
pub const fn y(&self) -> i32
pub const fn h(&self) -> i32
pub const fn w(&self) -> i32
pub const fn minw(&self) -> i32
pub const fn maxw(&self) -> i32
pub const fn minh(&self) -> i32
pub const fn maxh(&self) -> i32
pub fn clear_minmax(&mut self)
pub fn set_x(&mut self, value: i32)
pub fn set_y(&mut self, value: i32)
pub fn set_h(&mut self, value: i32)
pub fn set_w(&mut self, value: i32)
pub fn set_minw(&mut self, value: i32)
pub fn set_maxw(&mut self, value: i32)
pub fn set_minh(&mut self, value: i32)
pub fn set_maxh(&mut self, value: i32)
pub const fn contains_point(&self, x: i32, y: i32) -> bool
pub const fn contains_xyhw(&self, other: &Self) -> bool
pub const fn volume(&self) -> u64
Sourcepub const fn without(&self, other: &Self) -> Self
pub const fn without(&self, other: &Self) -> Self
Trim a Xyhw out of another Xyhw so that they don’t overlap.
pub fn center_halfed(&self) -> Self
pub fn center_relative(&mut self, outer: Self, border: i32)
pub const fn center(&self) -> (i32, i32)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Xyhw
impl<'de> Deserialize<'de> for Xyhw
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Xyhw> for XyhwChange
impl From<Xyhw> for XyhwChange
Source§impl From<XyhwBuilder> for Xyhw
impl From<XyhwBuilder> for Xyhw
Source§fn from(xywh: XyhwBuilder) -> Self
fn from(xywh: XyhwBuilder) -> Self
Converts to this type from the input type.
impl Copy for Xyhw
impl Eq for Xyhw
impl StructuralPartialEq for Xyhw
Auto Trait Implementations§
impl Freeze for Xyhw
impl RefUnwindSafe for Xyhw
impl Send for Xyhw
impl Sync for Xyhw
impl Unpin for Xyhw
impl UnwindSafe for Xyhw
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