C

DashStyle

The style of dashing a Stroke defined by its dashes and offset.
Inheritance Hierarchy

Remarks

All of these values are in terms of multiples of the thickness of a Stroke. This is different from the corresponding properties of an SVG stroke.

This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.

CSS border-style strings are converted to DashStyles. For example:

'solid'
'dash'
'dot'
'dash-dot'
'dash-dot-dot'
'5 10'
'5, 10'

It is also possible to specify an Array<Object> or to define the pattern of dashes:

[5, 10]
10

Members

No filters for this type

Constructors

Initializes a new instance of the DashStyle class using the provided dash pattern and offset.
By default, an empty pattern is used for the dashes and a value of 0.0 for the offset.

Parameters

dashes?: number[]
The pattern of dashes and gaps.
offset?: number
The dash offset.

Properties

Gets or sets the pattern of dashes and gaps.
Note that both an empty pattern and null result in a solid Stroke.
final

Property Value

The pattern of dashes and gaps.
Gets or sets the offset where the dash pattern starts.
final

Property Value

The offset.

Methods

Clones this instance by returning a memberwise clone, or by returning this if this instance is frozen.
final

Return Value

any
An instance of the same type as this instance.
Freezes and returns this instance.
Freezing an object makes it immutable, which can result in performance enhancements.
final

Return Value

DashStyle
This instance, made immutable.
Determines if this instance is frozen.
final

Return Value

boolean
true if this instance is frozen; otherwise, false.

Constants

Gets the dash style with a single dash.
This style is designed for dash caps that extend into the 'gaps' like SQUARE and ROUND. A pen with this style doesn't look as expected if its dash cap is FLAT. Since FLAT is the default value, you should explicitly set another value.
staticreadonly

Property Value

The 'dash' dash style.
Gets the dash style with a single dash and dot.
This style is designed for dash caps that extend into the 'gaps' like SQUARE and ROUND. A pen with this style doesn't contain visible dots if its dash cap is FLAT. Since FLAT is the default value, you should explicitly set another value.
staticreadonly

Property Value

The 'dash-dot' dash style.
Gets the dash style with a single dash and two dots.
This style is designed for dash caps that extend into the 'gaps' like SQUARE and ROUND. A pen with this style doesn't contain visible dots if its dash cap is FLAT. Since FLAT is the default value, you should explicitly set another value.
staticreadonly

Property Value

The 'dash-dot-dot' dash style.
Gets the dash style with a single dot.
This style is designed for dash caps that extend into the 'gaps' like SQUARE and ROUND. A pen with this style doesn't contain visible dots if its dash cap is FLAT. Since FLAT is the default value, you should explicitly set another value.
staticreadonly

Property Value

The 'dot' dash style.
Gets the solid dash style with no dashes.
staticreadonly

Property Value

The solid dash style.

Static Methods

Creates a DashStyle instance from the given dash-like object by performing automatic type conversion.
static

Parameters

dashLike: DashStyle
The object to convert to a DashStyle.

Return Value

DashStyle
The given dashLike if it is already a DashStyle, or a new instance initialized to the values found in dashLike.