pub struct StrokeMarker2d { /* private fields */ }Expand description
Reusable arrow marker definition for a line endpoint.
Marker dimensions are logical pixels even when the line body uses a world width, keeping scientific annotations readable under camera zoom. By default, a marked endpoint ignores the ordinary cap: the body ends with a butt boundary at the path endpoint, which is also the marker base. The filled triangle grows outward from the path, so markers remain interior-disjoint from arbitrarily short, dashed, or camera-scaled terminal segments.
Implementations§
Source§impl StrokeMarker2d
impl StrokeMarker2d
Sourcepub const fn arrow(length: LogicalPixels, width: LogicalPixels) -> Self
pub const fn arrow(length: LogicalPixels, width: LogicalPixels) -> Self
Builds a filled triangular arrow marker.
Sourcepub const fn with_anchor(self, anchor: StrokeMarkerAnchor2d) -> Self
pub const fn with_anchor(self, anchor: StrokeMarkerAnchor2d) -> Self
Selects the marker anchor. Tip anchoring uses the bounded exact-vector
contract documented by StrokeMarkerAnchor2d::TipAtEndpoint.
Sourcepub const fn anchor(self) -> StrokeMarkerAnchor2d
pub const fn anchor(self) -> StrokeMarkerAnchor2d
Returns how the marker is anchored to the mathematical endpoint.
Sourcepub const fn length(self) -> LogicalPixels
pub const fn length(self) -> LogicalPixels
Returns marker length along the endpoint tangent.
Sourcepub const fn width(self) -> LogicalPixels
pub const fn width(self) -> LogicalPixels
Returns full marker width perpendicular to the endpoint tangent.