#[repr(C)]pub enum CoordinateSpace {
Window = 0,
ScrollFrame = 1,
Parent = 2,
ReferenceFrame = 3,
}Expand description
Marker enum documenting which coordinate space a geometric value is in.
This is for documentation and debugging purposes only — it does not enforce
type safety at compile time. Use comments like [CoordinateSpace::Window]
or [CoordinateSpace::ScrollFrame] in code to document coordinate contexts.
Common bug pattern: passing Window-space coordinates where
ScrollFrame-space is expected (or vice versa). The scroll frame creates a
new spatial node, so primitives must be offset by the frame origin.
Variants§
Window = 0
Absolute coordinates from window top-left (0,0). Layout engine output is in this space.
ScrollFrame = 1
Relative to scroll frame content origin.
Transformation: scroll_pos = window_pos - scroll_frame_origin
Parent = 2
Relative to parent node’s content box origin.
ReferenceFrame = 3
Relative to a CSS transform reference frame origin.
Trait Implementations§
Source§impl Clone for CoordinateSpace
impl Clone for CoordinateSpace
Source§fn clone(&self) -> CoordinateSpace
fn clone(&self) -> CoordinateSpace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more