DashedStrokePattern
A stroke pattern of alternating dashes and gaps, defined by segments.
Inherits: StrokePattern
Properties
pattern_fit- Determines how this stroke pattern should be fit to a line when their lengths are not equal or multiples.segments- A list of even length with a minimum of 2, in the form of[a₁, b₁, (a₂, b₂, ...)], whereashould be the length of segments in 'units', andbthe length of the space after each segment in units.
Properties
pattern_fitclass-attributeinstance-attribute
pattern_fit: PatternFit = PatternFit.SCALE_UPDetermines how this stroke pattern should be fit to a line when their lengths are not equal or multiples.
segmentsinstance-attribute
segments: list[Number]A list of even length with a minimum of 2, in the form of
[a₁, b₁, (a₂, b₂, ...)], where a should be the length of segments in
'units', and b the length of the space after each segment in units. Both
values must be strictly positive.
'Units' refers to pixels, unless the pattern has been scaled due to the pattern_fit being flet_map.PatternFit.SCALE_UP.
If more than two items are specified, then each segments will alternate/iterate through the values.
For example, [50, 10, 10, 10] will cause:
- a segment of length 50px
- followed by a space of 10px
- followed by a segment of length 10px
- followed by a space of 10px
- followed by a segment of length of 50px
- followed by a space of 10px
- and so on ...
Raises:
- ValueError - If the list does not contain at least two items, or if its length is not even.