pub(crate) struct HitTest<'a> {
flags: ElementsFromPointFlags,
point_to_test: LayoutPoint,
projected_point_to_test: Option<(ScrollTreeNodeId, LayoutPoint, FastLayoutTransform)>,
stacking_context_tree: &'a StackingContextTree,
results: Vec<ElementsFromPointResult>,
clip_hit_test_results: HashMap<ClipId, bool>,
}
Fields§
§flags: ElementsFromPointFlags
The flags which describe how to perform this HitTest
.
point_to_test: LayoutPoint
The point to test for this hit test, relative to the page.
projected_point_to_test: Option<(ScrollTreeNodeId, LayoutPoint, FastLayoutTransform)>
A cached version of Self::point_to_test
projected to a spatial node, to avoid
doing a lot of matrix math over and over.
stacking_context_tree: &'a StackingContextTree
The stacking context tree against which to perform the hit test.
results: Vec<ElementsFromPointResult>
The resulting [HitTestResultItems
] for this hit test.
clip_hit_test_results: HashMap<ClipId, bool>
A cache of hit test results for shared clip nodes.
Implementations§
Source§impl<'a> HitTest<'a>
impl<'a> HitTest<'a>
pub(crate) fn run( stacking_context_tree: &'a StackingContextTree, point_to_test: LayoutPoint, flags: ElementsFromPointFlags, ) -> Vec<ElementsFromPointResult>
Sourcefn hit_test_clip_id(&mut self, clip_id: ClipId) -> bool
fn hit_test_clip_id(&mut self, clip_id: ClipId) -> bool
Perform a hit test against a the clip node for the given ClipId
, returning
true if it is not clipped out or false if is clipped out.
Sourcefn location_in_spatial_node(
&mut self,
scroll_tree_node_id: ScrollTreeNodeId,
) -> Option<(LayoutPoint, FastLayoutTransform)>
fn location_in_spatial_node( &mut self, scroll_tree_node_id: ScrollTreeNodeId, ) -> Option<(LayoutPoint, FastLayoutTransform)>
Get the hit test location in the coordinate system of the given spatial node,
returning None
if the transformation is uninvertible or the point cannot be
projected into the spatial node.
Auto Trait Implementations§
impl<'a> Freeze for HitTest<'a>
impl<'a> !RefUnwindSafe for HitTest<'a>
impl<'a> !Send for HitTest<'a>
impl<'a> !Sync for HitTest<'a>
impl<'a> Unpin for HitTest<'a>
impl<'a> !UnwindSafe for HitTest<'a>
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert