Skip to main content

Class: PatternPathStream

A TransformingPathStream which converts an input path into path commands to draw a repeating pattern along the input path.

Implements

Constructors

constructor

new PatternPathStream(consumer, pattern): PatternPathStream

Constructor.

Parameters

NameTypeDescription
consumerPathStreamThe path stream that consumes this stream's transformed output.
patternnull | PathPatternThe pattern drawn by this stream. If the pattern is null, then this stream will pass through path commands to its consumer without transforming them into a pattern.

Returns

PatternPathStream

Defined in

src/sdk/graphics/path/PatternPathStream.ts:53

Methods

arc

arc(x, y, radius, startAngle, endAngle, counterClockwise?): void

Paths an arc.

Parameters

NameTypeDescription
xnumberThe x-coordinate of the center of the circle containing the arc.
ynumberThe y-coordinate of the center of the circle containing the arc.
radiusnumberThe radius of the arc.
startAnglenumberThe angle of the start of the arc, in radians.
endAnglenumberThe angle of the end of the arc, in radians.
counterClockwise?booleanWhether the arc should be drawn counterclockwise. False by default.

Returns

void

Implementation of

TransformingPathStream.arc

Defined in

src/sdk/graphics/path/PatternPathStream.ts:217


beginPath

beginPath(): void

Begins a path. Erases all previous path state.

Returns

void

Implementation of

TransformingPathStream.beginPath

Defined in

src/sdk/graphics/path/PatternPathStream.ts:98


bezierCurveTo

bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y): void

Not supported by this path stream. Calling this method will execute a moveTo() command to the specified end point.

Parameters

NameTypeDescription
cp1xnumberThe x-coordinate of the first control point.
cp1ynumberThe y-coordinate of the first control point.
cp2xnumberThe x-coordinate of the second control point.
cp2ynumberThe y-coordinate of the second control point.
xnumberThe x-coordinate of the end point.
ynumberThe y-coordinate of the end point.

Returns

void

Implementation of

TransformingPathStream.bezierCurveTo

Defined in

src/sdk/graphics/path/PatternPathStream.ts:200


closePath

closePath(): void

Paths a line from the current point to the first point defined by the current path.

Returns

void

Implementation of

TransformingPathStream.closePath

Defined in

src/sdk/graphics/path/PatternPathStream.ts:306


getConsumer

getConsumer(): PathStream

Gets the path stream that is consuming this stream's transformed output.

Returns

PathStream

The path stream that is consuming this stream's transformed output.

Implementation of

TransformingPathStream.getConsumer

Defined in

src/sdk/graphics/path/PatternPathStream.ts:88


getPattern

getPattern(): null | PathPattern

Gets the pattern drawn by this stream.

Returns

null | PathPattern

The pattern drawn by this stream.

Defined in

src/sdk/graphics/path/PatternPathStream.ts:62


lineTo

lineTo(x, y): void

Paths a straight line from the current point to a specified point.

Parameters

NameTypeDescription
xnumberThe x-coordinate of the end point.
ynumberThe y-coordinate of the end point.

Returns

void

Implementation of

TransformingPathStream.lineTo

Defined in

src/sdk/graphics/path/PatternPathStream.ts:122


moveTo

moveTo(x, y): void

Moves to a specified point.

Parameters

NameTypeDescription
xnumberThe x-coordinate of the point to which to move.
ynumberThe y-coordinate of the point to which to move.

Returns

void

Implementation of

TransformingPathStream.moveTo

Defined in

src/sdk/graphics/path/PatternPathStream.ts:104


quadraticCurveTo

quadraticCurveTo(cpx, cpy, x, y): void

Not supported by this path stream. Calling this method will execute a moveTo() command to the specified end point.

Parameters

NameTypeDescription
cpxnumberThe x-coordinate of the control point.
cpynumberThe y-coordinate of the control point.
xnumberThe x-coordinate of the end point.
ynumberThe y-coordinate of the end point.

Returns

void

Implementation of

TransformingPathStream.quadraticCurveTo

Defined in

src/sdk/graphics/path/PatternPathStream.ts:212


setConsumer

setConsumer(consumer): void

Sets the path stream that consumes this stream's transformed output.

Parameters

NameTypeDescription
consumerPathStreamThe new consuming path stream.

Returns

void

Implementation of

TransformingPathStream.setConsumer

Defined in

src/sdk/graphics/path/PatternPathStream.ts:93


setPattern

setPattern(pattern): void

Sets the pattern drawn by this stream. If the pattern is null, then this stream will pass through path commands to its consumer without transforming them into a pattern.

Parameters

NameTypeDescription
patternnull | PathPatternA pattern.

Returns

void

Defined in

src/sdk/graphics/path/PatternPathStream.ts:71