pub struct ResizeHitTest { /* private fields */ }Expand description
Hit-test helper for resize handles on windows with rounded corners.
macOS Tahoe uses a 26pt corner radius, which means the visual corner arc does not cover the full 19×19 resize hotspot. This struct expands the clickable area 8px beyond the visual corner edge so users can still grab the resize handle reliably.
Implementations§
Source§impl ResizeHitTest
impl ResizeHitTest
Sourcepub fn new(
window_size: PhysicalSize<u32>,
corner_radius: f32,
expansion: f32,
) -> Self
pub fn new( window_size: PhysicalSize<u32>, corner_radius: f32, expansion: f32, ) -> Self
Creates a new hit-test helper.
§Arguments
window_size— the current window size in physical pixels.corner_radius— the corner radius in points (e.g., 26.0 for Tahoe).expansion— extra pixels to expand beyond the visual edge (e.g., 8.0).
Sourcepub fn hit_test(&self, pos: PhysicalSize<u32>, corner_radius: f32) -> bool
pub fn hit_test(&self, pos: PhysicalSize<u32>, corner_radius: f32) -> bool
Tests whether pos (a point relative to the window’s top-left corner)
falls within the expanded resize-hit region for any corner.
The hit region for each corner is a square of side corner_radius + expansion,
anchored at the corner. A point is considered a hit if it falls within
any of the four corner squares.
Auto Trait Implementations§
impl Freeze for ResizeHitTest
impl RefUnwindSafe for ResizeHitTest
impl Send for ResizeHitTest
impl Sync for ResizeHitTest
impl Unpin for ResizeHitTest
impl UnsafeUnpin for ResizeHitTest
impl UnwindSafe for ResizeHitTest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more