pub struct ContentBoxLocal(/* private fields */);Expand description
Space 4 — relative to a node’s static CONTENT-box origin, own scroll NOT applied.
Padding and border have been removed (ContentInset), so this is the
space inline text is laid out in — but only for an UNSCROLLED box.
Implementations§
Source§impl ContentBoxLocal
impl ContentBoxLocal
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 ContentBoxLocal
impl ContentBoxLocal
Sourcepub const fn to_border_box_local(self, inset: ContentInset) -> BorderBoxLocal
pub const fn to_border_box_local(self, inset: ContentInset) -> BorderBoxLocal
Step back out to the border box (… − P − E → … − P).
Sourcepub const fn scrolled_by(self, own_scroll: ScrollOffset) -> ScrolledContentPoint
pub const fn scrolled_by(self, own_scroll: ScrollOffset) -> ScrolledContentPoint
Add back the node’s OWN scroll offset to reach the point in its
scrollable content (… − P − E → … − P − E + S).
Pass the node’s own offset only. This is the step both hit-test hosts
used to skip, which is why clicking in a horizontally scrolled text
field placed the caret scroll_x px to the left of the pointer.
Trait Implementations§
Source§impl Clone for ContentBoxLocal
impl Clone for ContentBoxLocal
Source§fn clone(&self) -> ContentBoxLocal
fn clone(&self) -> ContentBoxLocal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more