const class graphics::Stroke

sys::Obj
  graphics::Stroke

@Js
@Serializable { simple=true }

Source

Stroke defines the how to render shape outlines.

cap

const StrokeCap cap := StrokeCap.butt

Source

How to render line end caps. Default is butt.

dash

const Str? dash

Source

Dash pattern as space/comma separated numbers of dashes and gaps. If null then render as solid line.

defVal

const static Stroke defVal := makeFields

Source

Default value is width 1, no dash, butt cap, miter join.

equals

virtual override Bool equals(Obj? obj)

Source

Equality is based on fields

fromStr

static new fromStr(Str s, Bool checked := true)

Source

Parse from string format:

width [dash] cap join

Examples:

0.5
2 [1, 2]
round radius
hash

virtual override Int hash()

Source

Hash is based on fields

isNone

Bool isNone()

Source

Is the width set to zero

join

const StrokeJoin join := StrokeJoin.miter

Source

How to render line joins. Default is miter.

make

new make(|This| f)

Source

Make with an it-block

makeFields

new makeFields(Float width := 1.0f, Str? dash := null, StrokeCap cap := StrokeCap.butt, StrokeJoin join := StrokeJoin.miter)

Source

Make with fields

none

const static Stroke none := Stroke.makeFields(0.0)

Source

Value with width of zero

toSize

Stroke toSize(Float newWidth)

Source

Return this stroke with different width.

toStr

virtual override Str toStr()

Source

Return string format - see fromStr

width

const Float width := 1.0f

Source

Stroke width. Default is 1.