pub struct ViewportProximitySnapshot {
pub in_proximity: bool,
pub bounds: Rect,
pub viewport_intersection: Option<Rect>,
}Expand description
One settled viewport-proximity sample in logical window coordinates.
Bounds are transformed layout AABBs, not padded paint coverage. Rectangular clips are intersected; curved/rotated clips use their bounding envelopes. Opacity, alpha coverage, sibling occlusion and external windows are ignored.
Fields§
§in_proximity: boolWhether the target intersects the proximity region with positive area.
bounds: RectPresented layout bounds relative to the global visual viewport’s origin.
viewport_intersection: Option<Rect>Positive-area intersection with the global viewport and ancestor clips.
Implementations§
Source§impl ViewportProximitySnapshot
impl ViewportProximitySnapshot
Sourcepub fn is_in_viewport(&self) -> bool
pub fn is_in_viewport(&self) -> bool
Whether any positive-area viewport intersection exists.
Sourcepub fn intersection_ratio(&self) -> f64
pub fn intersection_ratio(&self) -> f64
Fraction of the layout AABB inside the effective viewport, from zero to one.
Trait Implementations§
Source§impl Clone for ViewportProximitySnapshot
impl Clone for ViewportProximitySnapshot
Source§fn clone(&self) -> ViewportProximitySnapshot
fn clone(&self) -> ViewportProximitySnapshot
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 ViewportProximitySnapshot
Source§impl Debug for ViewportProximitySnapshot
impl Debug for ViewportProximitySnapshot
impl StructuralPartialEq for ViewportProximitySnapshot
Auto Trait Implementations§
impl Freeze for ViewportProximitySnapshot
impl RefUnwindSafe for ViewportProximitySnapshot
impl Send for ViewportProximitySnapshot
impl Sync for ViewportProximitySnapshot
impl Unpin for ViewportProximitySnapshot
impl UnsafeUnpin for ViewportProximitySnapshot
impl UnwindSafe for ViewportProximitySnapshot
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.