pub struct HitboxFilter(/* private fields */);Expand description
A predicate that says whether a Hitbox is present at a window position.
A hitbox with a filter is only hit where the filter allows the position; everywhere else
hit-testing skips it — it neither claims the pointer nor blocks what is behind it — so the pointer
reaches whatever the element is drawn over. This is how an element whose content does not fill its
bounds declines the pointer over the gaps (see GpuCanvas::occlude_where). Unlike a hitbox’s
HitboxBehavior, which is fixed when a frame is built, the filter is asked at the event’s
position — so the answer neither lags a frame nor needs a redraw to take effect.
Implementations§
Trait Implementations§
Source§impl Clone for HitboxFilter
impl Clone for HitboxFilter
Auto Trait Implementations§
impl !RefUnwindSafe for HitboxFilter
impl !Send for HitboxFilter
impl !Sync for HitboxFilter
impl !UnwindSafe for HitboxFilter
impl Freeze for HitboxFilter
impl Unpin for HitboxFilter
impl UnsafeUnpin for HitboxFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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