Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::StrokeStyle Struct Reference

Everything needed to stroke a path, as one value. More...

#include <path.hpp>

Public Member Functions

bool operator== (const StrokeStyle &o) const
bool operator!= (const StrokeStyle &o) const

Public Attributes

float width = 1.0f
LineCap cap = LineCap::butt
LineJoin join = LineJoin::miter
float miter_limit = 4.0f
std::vector< float > dash
 Dash pattern: alternating on/off lengths in user units.
float dash_phase = 0.0f

Detailed Description

Everything needed to stroke a path, as one value.

Bundling these means stroke_path(path, style) is a single call that cannot be half-configured — the immediate-mode API's set_line_width / set_line_cap / set_line_join triplet leaks state between draws and is a recurring source of "why is this stroke the wrong width" bugs.

Member Function Documentation

◆ operator!=()

bool pulp::canvas::StrokeStyle::operator!= ( const StrokeStyle & o) const
inline

◆ operator==()

bool pulp::canvas::StrokeStyle::operator== ( const StrokeStyle & o) const
inline

Member Data Documentation

◆ cap

LineCap pulp::canvas::StrokeStyle::cap = LineCap::butt

◆ dash

std::vector<float> pulp::canvas::StrokeStyle::dash

Dash pattern: alternating on/off lengths in user units.

Empty = solid. An odd-length pattern is repeated to make it even, per the SVG and Canvas2D convention ([5] behaves as [5, 5]).

◆ dash_phase

float pulp::canvas::StrokeStyle::dash_phase = 0.0f

◆ join

LineJoin pulp::canvas::StrokeStyle::join = LineJoin::miter

◆ miter_limit

float pulp::canvas::StrokeStyle::miter_limit = 4.0f

◆ width

float pulp::canvas::StrokeStyle::width = 1.0f

The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/canvas/include/pulp/canvas/path.hpp