Constructor
new Stroke(lineWidthopt, lineCapopt, lineJoinopt, miterLimitopt)
Stroke constructor
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
lineWidth | number | <optional> | 1 | The line width of the stroke |
lineCap | string | <optional> | 'butt' | The line ending type. Possible values are: |
lineJoin | string | <optional> | 'miter' | The type of drawing used when two lines join. Possible |
miterLimit | number | <optional> | 10 | The ratio between the miter length and half |
Members
lineCap :string
The line ending type (butt
, round
or square
)
- string
lineJoin :string
The drawing used when two lines join (round
, bevel
or miter
)
- string
lineWidth :number
The line width
- number
miterLimit :number
Ratio between the miter length and half lineWidth
- number
Methods
getAttributes() → {object}
Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.
- The resulting object, with minimal attrributes
- Type:
- object
setAttributes(data) → {module:AWT.Stroke}
Reads the properties of this Stroke from a data object
Name | Type | Description |
---|---|---|
data | object | The data object to be parsed |
- Type:
- module:AWT.
Stroke
setStroke(ctx) → {external:CanvasRenderingContext2D}
Sets the properties of this stroke to a CanvasRenderingContext2D
Name | Type | Description |
---|---|---|
ctx | external:CanvasRenderingContext2D | The canvas 2D rendering context |