Skip to main content

Class: ClippedPathStream

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:37

A path stream which performs clipping to an axis-aligned rectangular bounding box before sending the clipped path to another stream. Clipping is only supported for path segments added via the lineTo() and arc() methods. Path segments added via bezierCurveTo() and quadraticCurveTo() will be passed to the consumer stream unclipped.

Extends​

Constructors​

Constructor​

new ClippedPathStream(consumer, bounds): ClippedPathStream

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:65

Constructor.

Parameters​

ParameterTypeDescription
consumerPathStreamThe path stream that consumes this stream's transformed output.
boundsSubscribable<Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>>A subscribable which provides the clipping bounds for this stream, as [left, top, right, bottom]. Whenever the clipping bounds change, the state of this stream will be reset, as if beginPath() were called.

Returns​

ClippedPathStream

Overrides​

AbstractTransformingPathStream.constructor

Properties​

consumer​

protected consumer: PathStream

Defined in: src/sdk/graphics/path/PathStream.ts:144

The path stream that consumes this stream's transformed output.

Inherited from​

AbstractTransformingPathStream.consumer

Methods​

arc()​

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

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:249

Paths an arc.

Parameters​

ParameterTypeDefault valueDescription
xnumberundefinedThe x-coordinate of the center of the circle containing the arc.
ynumberundefinedThe y-coordinate of the center of the circle containing the arc.
radiusnumberundefinedThe radius of the arc.
startAnglenumberundefinedThe angle of the start of the arc, in radians.
endAnglenumberundefinedThe angle of the end of the arc, in radians.
counterClockwisebooleanfalseWhether the arc should be drawn counterclockwise. False by default.

Returns​

void

Overrides​

AbstractTransformingPathStream.arc


beginPath()​

beginPath(): void

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:72

Begins a path. Erases all previous path state.

Returns​

void

Overrides​

AbstractTransformingPathStream.beginPath


bezierCurveTo()​

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

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:199

Paths a cubic Bezier curve from the current point to a specified point.

Parameters​

ParameterTypeDescription
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

Overrides​

AbstractTransformingPathStream.bezierCurveTo


closePath()​

closePath(): void

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:415

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

Returns​

void

Overrides​

AbstractTransformingPathStream.closePath


destroy()​

destroy(): void

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:474

Destroys this stream.

Returns​

void


getConsumer()​

getConsumer(): PathStream

Defined in: src/sdk/graphics/path/PathStream.ts:148

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.

Inherited from​

AbstractTransformingPathStream.getConsumer


lineTo()​

lineTo(x, y): void

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:103

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

Parameters​

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

Returns​

void

Overrides​

AbstractTransformingPathStream.lineTo


moveTo()​

moveTo(x, y): void

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:78

Moves to a specified point.

Parameters​

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

Returns​

void

Overrides​

AbstractTransformingPathStream.moveTo


quadraticCurveTo()​

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

Defined in: src/sdk/graphics/path/ClippedPathStream.ts:224

Paths a quadrative Bezier curve from the current point to a specified point.

Parameters​

ParameterTypeDescription
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

Overrides​

AbstractTransformingPathStream.quadraticCurveTo


setConsumer()​

setConsumer(consumer): void

Defined in: src/sdk/graphics/path/PathStream.ts:153

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

Parameters​

ParameterTypeDescription
consumerPathStreamThe new consuming path stream.

Returns​

void

Inherited from​

AbstractTransformingPathStream.setConsumer