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