Skip to content

Point

Defined in: src/Point.ts:13

Adaptation of work of Kevin Lindsey(kevin@kevlindev.com)

new Point(): Point

Defined in: src/Point.ts:18

Point

new Point(x, y): Point

Defined in: src/Point.ts:19

number

number

Point

new Point(point?): Point

Defined in: src/Point.ts:20

XY

Point

x: number

Defined in: src/Point.ts:14

XY.x


y: number

Defined in: src/Point.ts:16

XY.y

add(that): Point

Defined in: src/Point.ts:36

Adds another point to this one and returns another one

XY

Point

new Point instance with added values


addEquals(that): Point

Defined in: src/Point.ts:47

Adds another point to this one

XY

Point

thisArg


clone(): Point

Defined in: src/Point.ts:347

return a cloned instance of the point

Point


distanceFrom(that): number

Defined in: src/Point.ts:246

Returns distance from this point and another one

XY

number


divide(that): Point

Defined in: src/Point.ts:155

Divides this point by another and returns a new one

XY

Point


eq(that): boolean

Defined in: src/Point.ts:186

Returns true if this point is equal to another one

XY

boolean


gt(that): boolean

Defined in: src/Point.ts:214

Returns true if this point is greater another one

XY

boolean


gte(that): boolean

Defined in: src/Point.ts:223

Returns true if this point is greater than or equal to another one

XY

boolean


lerp(that, t): Point

Defined in: src/Point.ts:233

Returns new point which is the result of linear interpolation with this one and another one

XY

number = 0.5

, position of interpolation, between 0 and 1 default 0.5

Point


lt(that): boolean

Defined in: src/Point.ts:195

Returns true if this point is less than another one

XY

boolean


lte(that): boolean

Defined in: src/Point.ts:204

Returns true if this point is less than or equal to another one

XY

boolean


max(that): Point

Defined in: src/Point.ts:275

Returns a new point which is the max of this and another one

XY

Point


midPointFrom(that): Point

Defined in: src/Point.ts:257

Returns the point between this point and another one

XY

Point


min(that): Point

Defined in: src/Point.ts:266

Returns a new point which is the min of this and another one

XY

Point


multiply(that): Point

Defined in: src/Point.ts:124

Multiplies this point by another value and returns a new one

XY

Point


rotate(radians, origin): Point

Defined in: src/Point.ts:359

Rotates point around origin with radians

TRadian

The radians of the angle for the rotation

XY = ZERO

The origin of the rotation

Point

The new rotated point

fabric.util


scalarAdd(scalar): Point

Defined in: src/Point.ts:58

Adds value to this point and returns a new one

number

Point

new Point with added value


scalarAddEquals(scalar): Point

Defined in: src/Point.ts:69

Adds value to this point

number

Point

thisArg


scalarDivide(scalar): Point

Defined in: src/Point.ts:164

Divides this point by a value and returns a new one

number

Point


scalarDivideEquals(scalar): Point

Defined in: src/Point.ts:175

Divides this point by a value

number

Point

thisArg


scalarMultiply(scalar): Point

Defined in: src/Point.ts:133

Multiplies this point by a value and returns a new one

number

Point


scalarMultiplyEquals(scalar): Point

Defined in: src/Point.ts:144

Multiplies this point by a value

number

Point

thisArg


scalarSubtract(scalar): Point

Defined in: src/Point.ts:102

Subtracts value from this point and returns a new one

number

Point


scalarSubtractEquals(scalar): Point

Defined in: src/Point.ts:113

Subtracts value from this point

number

Point

thisArg


setFromPoint(that): Point

Defined in: src/Point.ts:324

Sets x/y of this point from another point

XY

Point


setX(x): Point

Defined in: src/Point.ts:304

Sets x of this point

number

Point


setXY(x, y): Point

Defined in: src/Point.ts:293

Sets x/y of this point

number

number

Point


setY(y): Point

Defined in: src/Point.ts:314

Sets y of this point

number

Point


subtract(that): Point

Defined in: src/Point.ts:80

Subtracts another point from this point and returns a new one

XY

Point

new Point object with subtracted values


subtractEquals(that): Point

Defined in: src/Point.ts:91

Subtracts another point from this point

XY

Point

thisArg


swap(that): void

Defined in: src/Point.ts:334

Swaps x/y of this point and another point

XY

void


toString(): string

Defined in: src/Point.ts:283

Returns string representation of this point

string


transform(t, ignoreOffset?): Point

Defined in: src/Point.ts:380

Apply transform t to point p

TMat2D

The transform

boolean = false

Indicates that the offset should not be applied

Point

The transformed point

fabric.util