pub struct StaticLayoutPoint(/* private fields */);Expand description
Space 2 — a window point mapped into a DOM’s STATIC layout coordinate system: every scrolling ANCESTOR’s offset added back (and any ancestor transform inverted).
This is the space calculated_positions lives in, so a
StaticLayoutPoint may be compared against a node’s static rect. It is
what CpuHitTester::hit_test_scrolled returns and what
headless::resolve_chain’s map_screen_to_local produces.
It does NOT include the node’s own scroll offset: a container’s own scrolling moves its CONTENT, never its box.
Implementations§
Source§impl StaticLayoutPoint
impl StaticLayoutPoint
Sourcepub const fn new(p: LogicalPosition) -> Self
pub const fn new(p: LogicalPosition) -> Self
Assert that p is already in this space.
Only correct at a PRODUCER boundary — the place that computed the point and therefore knows which space it is in. Everywhere else, use one of the named conversions instead; that is the entire point of this module.
Sourcepub const fn get(self) -> LogicalPosition
pub const fn get(self) -> LogicalPosition
Drop back to an untyped position.
Only correct at a CONSUMER boundary that documents which space it wants.
Source§impl StaticLayoutPoint
impl StaticLayoutPoint
Sourcepub const fn to_window(self, ancestor_scroll: ScrollOffset) -> WindowPoint
pub const fn to_window(self, ancestor_scroll: ScrollOffset) -> WindowPoint
Back to window space (w + A → w).
Sourcepub const fn to_border_box_local(
self,
border_box_origin: LogicalPosition,
) -> BorderBoxLocal
pub const fn to_border_box_local( self, border_box_origin: LogicalPosition, ) -> BorderBoxLocal
Make the point node-local by subtracting the node’s STATIC border-box
origin (w + A → w + A − P).
Trait Implementations§
Source§impl Clone for StaticLayoutPoint
impl Clone for StaticLayoutPoint
Source§fn clone(&self) -> StaticLayoutPoint
fn clone(&self) -> StaticLayoutPoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more