- Index
- »
- fan.graphics
- »
- Stroke
Stroke
@Js
@Serializable { simple=true }
const class Stroke : Obj
Stroke defines the how to render shape outlines.
Parse from string format
Make with fields
Make with an it-block
How to render line end caps
Stroke width
How to render line joins
Value with width of zero
Dash pattern as space/comma separated numbers of dashes and gaps
Default value is width 1, no dash, butt cap, miter join
Return string format - see fromStr
Is the width set to zero
Equality is based on fields
Scale size and dash pattern by given ratio
Return this stroke with different width
Hash is based on fields
const StrokeCap : cap
How to render line end caps. Default is butt.
const Str? : dash
Dash pattern as space/comma separated numbers of dashes and gaps. If null then render as solid line.
const static Stroke : defVal
Default value is width 1, no dash, butt cap, miter join.
virtual Bool equals(Obj? obj)
Equality is based on fields
static new fromStr(Str s, Bool checked)
Parse from string format:
width [dash] cap join
Examples:
0.5 2 [1, 2] round radius
virtual Int hash()
Hash is based on fields
Bool isNone()
Is the width set to zero
const StrokeJoin : join
How to render line joins. Default is miter.
new make(|This| f)
Make with an it-block
new makeFields(Float width, Str? dash, StrokeCap cap, StrokeJoin join)
Make with fields
const static Stroke : none
Value with width of zero
Stroke scale(Float ratio)
Scale size and dash pattern by given ratio
Stroke toSize(Float newWidth)
Return this stroke with different width.
virtual Str toStr()
Return string format - see fromStr
const Float : width
Stroke width. Default is 1.