pub enum ResizeCorner {
TopLeft,
TopRight,
BottomLeft,
BottomRight,
}Expand description
Which corner of a window an interactive resize is anchored to.
The anchored corner follows the pointer and the opposite one stays where it is, so dragging the top left corner grows the window up and to the left rather than dragging its bottom right corner around.
Variants§
Implementations§
Source§impl ResizeCorner
impl ResizeCorner
Sourcepub const fn nearest(
x: i32,
y: i32,
rect_x: i32,
rect_y: i32,
width: i32,
height: i32,
) -> Self
pub const fn nearest( x: i32, y: i32, rect_x: i32, rect_y: i32, width: i32, height: i32, ) -> Self
The corner of a rectangle closest to the given point.
The rectangle is split into quadrants around its centre, so a point
anywhere in the upper left quarter resolves to Self::TopLeft.
Sourcepub const fn point(
self,
rect_x: i32,
rect_y: i32,
width: i32,
height: i32,
) -> (i32, i32)
pub const fn point( self, rect_x: i32, rect_y: i32, width: i32, height: i32, ) -> (i32, i32)
Where this corner sits on a rectangle, which is where the pointer is repositioned when a resize starts.
Sourcepub const fn anchors_left(self) -> bool
pub const fn anchors_left(self) -> bool
Whether the left edge moves with the pointer instead of the right one.
Sourcepub const fn anchors_top(self) -> bool
pub const fn anchors_top(self) -> bool
Whether the top edge moves with the pointer instead of the bottom one.
Trait Implementations§
Source§impl Clone for ResizeCorner
impl Clone for ResizeCorner
Source§fn clone(&self) -> ResizeCorner
fn clone(&self) -> ResizeCorner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ResizeCorner
Source§impl Debug for ResizeCorner
impl Debug for ResizeCorner
Source§impl Default for ResizeCorner
impl Default for ResizeCorner
Source§fn default() -> ResizeCorner
fn default() -> ResizeCorner
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResizeCorner
impl<'de> Deserialize<'de> for ResizeCorner
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
impl Eq for ResizeCorner
Source§impl PartialEq for ResizeCorner
impl PartialEq for ResizeCorner
Source§impl Serialize for ResizeCorner
impl Serialize for ResizeCorner
impl StructuralPartialEq for ResizeCorner
Auto Trait Implementations§
impl Freeze for ResizeCorner
impl RefUnwindSafe for ResizeCorner
impl Send for ResizeCorner
impl Sync for ResizeCorner
impl Unpin for ResizeCorner
impl UnsafeUnpin for ResizeCorner
impl UnwindSafe for ResizeCorner
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