pub enum StrokeMetric {
World,
Clip,
}Expand description
Which space the stroke is measured in (ADR-0160) — the half-width, the join extensions and the direction all three are taken along.
A per-draw-call parameter rather than a per-instance field or a second
pipeline: it rides the segment uniform’s v.w, a lane that was unused, so it
costs no bytes, no bind-group entry and no new resource (ADR-0058).
Explicit at every call site rather than inferred from which entry point the caller used, so a producer that picks the wrong one is visible in its own source rather than implicit in a pipeline.
Variants§
World
World space, the isotropic one: a world displacement (dx, dy) lands
on (dx * H/2, dy * H/2) pixels whichever axis it is on, because
dividing x by the aspect is exactly what squares the space up. So the
half-width is a thickness on screen and the extension is a length on
screen, at every orientation.
What the four line families pass, and what makes a producer’s world-space interior angle the angle the shader extends along (ADR-0158).
Clip
Clip space, the anisotropic one: one clip x unit is aspect times as
many pixels as one clip y unit, so a vertical stroke is aspect times
thicker on screen than a horizontal one at the same width.
warp_mesh is the one surface on it, and it is a dated deferral, not
an endorsement — see the comment at its call site.
Trait Implementations§
Source§impl Clone for StrokeMetric
impl Clone for StrokeMetric
Source§fn clone(&self) -> StrokeMetric
fn clone(&self) -> StrokeMetric
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StrokeMetric
impl Debug for StrokeMetric
Source§impl PartialEq for StrokeMetric
impl PartialEq for StrokeMetric
Source§fn eq(&self, other: &StrokeMetric) -> bool
fn eq(&self, other: &StrokeMetric) -> bool
self and other values to be equal, and is used by ==.impl Copy for StrokeMetric
impl Eq for StrokeMetric
impl StructuralPartialEq for StrokeMetric
Auto Trait Implementations§
impl Freeze for StrokeMetric
impl RefUnwindSafe for StrokeMetric
impl Send for StrokeMetric
impl Sync for StrokeMetric
impl Unpin for StrokeMetric
impl UnsafeUnpin for StrokeMetric
impl UnwindSafe for StrokeMetric
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.