pub struct ResolvedMask {
pub half_extents: [f32; 2],
pub corner_radius_px: f32,
}Expand description
What core computes for the shader: the target surface’s half-extents (physical px) and the
physical corner radius, clamped to min(half_extent) so the rounded-rect SDF can never
overshoot into a malformed shape. The per-pixel SDF is the shader’s job; this is its
resolved, GPU-agnostic input — which is exactly what makes the clamp headless-testable
(DESIGN §4.3, §11).
Fields§
§half_extents: [f32; 2]Half the target rect’s width and height, in physical pixels.
corner_radius_px: f32The clamped physical corner radius, in physical pixels.
Implementations§
Source§impl ResolvedMask
impl ResolvedMask
Sourcepub fn from_target(target: &Region, corner_radius: CornerRadius) -> Self
pub fn from_target(target: &Region, corner_radius: CornerRadius) -> Self
Resolve the mask for a target rect: half-extents from its size, and the corner radius
scaled to physical pixels then clamped to min(half_width, half_height). The
half-extents derive from u32 sizes, so they are non-negative and the clamp’s
min <= max precondition always holds.
Trait Implementations§
Source§impl Clone for ResolvedMask
impl Clone for ResolvedMask
Source§fn clone(&self) -> ResolvedMask
fn clone(&self) -> ResolvedMask
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResolvedMask
Source§impl Debug for ResolvedMask
impl Debug for ResolvedMask
Source§impl PartialEq for ResolvedMask
impl PartialEq for ResolvedMask
Source§fn eq(&self, other: &ResolvedMask) -> bool
fn eq(&self, other: &ResolvedMask) -> bool
self and other values to be equal, and is used by ==.