pub struct OverlayPolylineItem {
pub points: Vec<[f32; 2]>,
pub thickness: f32,
pub colour: [f32; 4],
pub join: LineJoin,
pub mitre_limit: f32,
pub closed: bool,
pub fill: Option<OverlayFill>,
pub texture: Option<OverlayTextureId>,
pub uvs: Option<Vec<[f32; 2]>>,
pub texture_transform: TextureTransform,
pub opacity: f32,
pub z_order: i32,
}Expand description
A stroked polyline rendered as a screen-space overlay.
Constructed from a list of waypoints in logical pixels. Tessellated on the CPU into a triangle list each frame; rendered through the same pipeline as overlay rects and labels (no SDF, no shader changes).
Use OverlayPolylineItem::from_path to construct from a closure that
samples a curve at N points (Bezier traces, lissajous, custom paths).
Fields§
§points: Vec<[f32; 2]>Waypoints in logical pixels from the viewport top-left.
thickness: f32Stroke thickness in logical pixels.
colour: [f32; 4]RGBA colour in linear float format.
join: LineJoinHow segment joints are drawn.
mitre_limit: f32Mitre limit: when the mitre extension exceeds this multiple of
thickness, the joint auto-falls back to a bevel.
closed: boolWhen true, the last point connects back to the first.
fill: Option<OverlayFill>Optional interior fill. Only used when closed is true.
Texture fills use this the same way OverlayShapeItem does: when
texture is set, OverlayFill::Solid acts as a tint. Gradient fills
are ignored for textured interiors.
texture: Option<OverlayTextureId>Optional texture fill for the interior. Only used when closed is true.
The polygon is clipped by triangulating the closed path. UVs are
derived from the path bounds unless uvs has one entry per point.
uvs: Option<Vec<[f32; 2]>>Optional per-point UVs for textured interiors.
When set, this must have the same length as points. Otherwise the
renderer falls back to bounds-mapped UVs.
texture_transform: TextureTransformAffine transform applied to texture UVs before sampling.
opacity: f32Overall opacity multiplier in [0, 1].
z_order: i32Draw order relative to other overlay rects, polylines, and labels. Lower values render first (further back).
Implementations§
Source§impl OverlayPolylineItem
impl OverlayPolylineItem
Sourcepub fn from_path(
path: impl Fn(f32) -> [f32; 2],
samples: u32,
thickness: f32,
colour: [f32; 4],
) -> Self
pub fn from_path( path: impl Fn(f32) -> [f32; 2], samples: u32, thickness: f32, colour: [f32; 4], ) -> Self
Construct a polyline by sampling the given closure at samples + 1
evenly-spaced parameter values across [0, 1]. The closure is called
once per sample at construction time; the resulting points are stored
in self.points.
Consumers wanting non-uniform sample density (denser around tight curvature) should sample manually and build the item via the regular struct literal.
Trait Implementations§
Source§impl Clone for OverlayPolylineItem
impl Clone for OverlayPolylineItem
Source§fn clone(&self) -> OverlayPolylineItem
fn clone(&self) -> OverlayPolylineItem
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 OverlayPolylineItem
impl Debug for OverlayPolylineItem
Auto Trait Implementations§
impl Freeze for OverlayPolylineItem
impl RefUnwindSafe for OverlayPolylineItem
impl Send for OverlayPolylineItem
impl Sync for OverlayPolylineItem
impl Unpin for OverlayPolylineItem
impl UnsafeUnpin for OverlayPolylineItem
impl UnwindSafe for OverlayPolylineItem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.