Freigeben über


IWetStroke interface

Defines a "wet" stroke, i.e. a stroke as it's being drawn.

Extends

Properties

mode

The wet stroke's mode.

type

The type of the wet stroke.

Inherited Properties

brush

The brush used to draw the stroke.

clientId

Optional. The id of the client the stroke was created on.

id

The id of the stroke.

length

The number of points in the stroke.

timeStamp

The timestamp when the stroke was created.

Methods

cancel()

Cancels the wet stroke.

end()

Ends the wet stroke.

straighten(IPointerPoint)

Straightens a point so that the line it forms with the previous point is straight (either horizontal or vertical).

Inherited Methods

addPoints(IPointerPoint[])

Adds points to the stroke.

deserialize(string)

Deserializes the specified stroke string and sets this stroke's brush, points and other proprties accordingly.

getAllPoints()

Gets a copy of all the points in the stroke.

getBoundingRect()

Computes the stroke's bounding rectangle.

getIntersectionPoints(ISegment)

Computes the intersection points between the stroke and the specified segment.

getPointAt(number)

Gets the point at the given index.

intersectsWithRectangle(IRect)

Determines if the stroke intersects with the specified rectangle.

pointErase(IRect)

Splits this stroke into several other ones by "erasing" the portions that are within the eraser rectangle.

serialize()

Serializes the stroke to a string.

Property Details

mode

The wet stroke's mode.

mode: StrokeMode

Property Value

type

The type of the wet stroke.

type: StrokeType

Property Value

Inherited Property Details

brush

The brush used to draw the stroke.

brush: IBrush

Property Value

Inherited From IStroke.brush

clientId

Optional. The id of the client the stroke was created on.

clientId?: string

Property Value

string

Inherited From IStroke.clientId

id

The id of the stroke.

id: string

Property Value

string

Inherited From IStroke.id

length

The number of points in the stroke.

length: number

Property Value

number

Inherited From IStroke.length

timeStamp

The timestamp when the stroke was created.

timeStamp: number

Property Value

number

Inherited From IStroke.timeStamp

Method Details

cancel()

Cancels the wet stroke.

function cancel()

end()

Ends the wet stroke.

function end()

straighten(IPointerPoint)

Straightens a point so that the line it forms with the previous point is straight (either horizontal or vertical).

function straighten(p: IPointerPoint): IPointerPoint

Parameters

p
IPointerPoint

The point to update

Returns

Inherited Method Details

addPoints(IPointerPoint[])

Adds points to the stroke.

function addPoints(points: IPointerPoint[]): boolean

Parameters

points

IPointerPoint[]

The points to add.

Returns

boolean

Inherited From IStroke.addPoints

deserialize(string)

Deserializes the specified stroke string and sets this stroke's brush, points and other proprties accordingly.

function deserialize(serializedStroke: string)

Parameters

serializedStroke

string

The serialized stroke.

Inherited From IStroke.deserialize

getAllPoints()

Gets a copy of all the points in the stroke.

function getAllPoints(): IPointerPoint[]

Returns

Inherited From IStroke.getAllPoints

getBoundingRect()

Computes the stroke's bounding rectangle.

function getBoundingRect(): IRect

Returns

Inherited From IStroke.getBoundingRect

getIntersectionPoints(ISegment)

Computes the intersection points between the stroke and the specified segment.

function getIntersectionPoints(segment: ISegment): IPoint[]

Parameters

segment
ISegment

The segment to test against.

Returns

IPoint[]

Inherited From IStroke.getIntersectionPoints

getPointAt(number)

Gets the point at the given index.

function getPointAt(index: number): IPointerPoint

Parameters

index

number

The point index.

Returns

Inherited From IStroke.getPointAt

intersectsWithRectangle(IRect)

Determines if the stroke intersects with the specified rectangle.

function intersectsWithRectangle(rectangle: IRect): boolean

Parameters

rectangle
IRect

The rectangle to test against.

Returns

boolean

Inherited From IStroke.intersectsWithRectangle

pointErase(IRect)

Splits this stroke into several other ones by "erasing" the portions that are within the eraser rectangle.

function pointErase(eraserRect: IRect): undefined | IStroke[]

Parameters

eraserRect
IRect

The eraser rectangle.

Returns

undefined | IStroke[]

Inherited From IStroke.pointErase

serialize()

Serializes the stroke to a string.

function serialize(): string

Returns

string

Inherited From IStroke.serialize