Point
Defined in: src/Point.ts:13
Adaptation of work of Kevin Lindsey(kevin@kevlindev.com)
Implements
Constructors
new Point()
new Point():
Point
Defined in: src/Point.ts:18
Returns
new Point()
new Point(
x
,y
):Point
Defined in: src/Point.ts:19
Parameters
x
number
y
number
Returns
new Point()
new Point(
point
?):Point
Defined in: src/Point.ts:20
Parameters
point?
Returns
Properties
x
x:
number
Defined in: src/Point.ts:14
Implementation of
y
y:
number
Defined in: src/Point.ts:16
Implementation of
Methods
add()
add(
that
):Point
Defined in: src/Point.ts:36
Adds another point to this one and returns another one
Parameters
that
Returns
new Point instance with added values
addEquals()
addEquals(
that
):Point
Defined in: src/Point.ts:47
Adds another point to this one
Parameters
that
Returns
thisArg
Chainable
clone()
clone():
Point
Defined in: src/Point.ts:347
return a cloned instance of the point
Returns
distanceFrom()
distanceFrom(
that
):number
Defined in: src/Point.ts:246
Returns distance from this point and another one
Parameters
that
Returns
number
divide()
divide(
that
):Point
Defined in: src/Point.ts:155
Divides this point by another and returns a new one
Parameters
that
Returns
eq()
eq(
that
):boolean
Defined in: src/Point.ts:186
Returns true if this point is equal to another one
Parameters
that
Returns
boolean
gt()
gt(
that
):boolean
Defined in: src/Point.ts:214
Returns true if this point is greater another one
Parameters
that
Returns
boolean
gte()
gte(
that
):boolean
Defined in: src/Point.ts:223
Returns true if this point is greater than or equal to another one
Parameters
that
Returns
boolean
lerp()
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
Parameters
that
t
number
= 0.5
, position of interpolation, between 0 and 1 default 0.5
Returns
lt()
lt(
that
):boolean
Defined in: src/Point.ts:195
Returns true if this point is less than another one
Parameters
that
Returns
boolean
lte()
lte(
that
):boolean
Defined in: src/Point.ts:204
Returns true if this point is less than or equal to another one
Parameters
that
Returns
boolean
max()
max(
that
):Point
Defined in: src/Point.ts:275
Returns a new point which is the max of this and another one
Parameters
that
Returns
midPointFrom()
midPointFrom(
that
):Point
Defined in: src/Point.ts:257
Returns the point between this point and another one
Parameters
that
Returns
min()
min(
that
):Point
Defined in: src/Point.ts:266
Returns a new point which is the min of this and another one
Parameters
that
Returns
multiply()
multiply(
that
):Point
Defined in: src/Point.ts:124
Multiplies this point by another value and returns a new one
Parameters
that
Returns
rotate()
rotate(
radians
,origin
):Point
Defined in: src/Point.ts:359
Rotates point
around origin
with radians
Parameters
radians
The radians of the angle for the rotation
origin
XY
= ZERO
The origin of the rotation
Returns
The new rotated point
Static
Member Of
fabric.util
scalarAdd()
scalarAdd(
scalar
):Point
Defined in: src/Point.ts:58
Adds value to this point and returns a new one
Parameters
scalar
number
Returns
new Point with added value
scalarAddEquals()
scalarAddEquals(
scalar
):Point
Defined in: src/Point.ts:69
Adds value to this point
Parameters
scalar
number
Returns
thisArg
Chainable
scalarDivide()
scalarDivide(
scalar
):Point
Defined in: src/Point.ts:164
Divides this point by a value and returns a new one
Parameters
scalar
number
Returns
scalarDivideEquals()
scalarDivideEquals(
scalar
):Point
Defined in: src/Point.ts:175
Divides this point by a value
Parameters
scalar
number
Returns
thisArg
Chainable
scalarMultiply()
scalarMultiply(
scalar
):Point
Defined in: src/Point.ts:133
Multiplies this point by a value and returns a new one
Parameters
scalar
number
Returns
scalarMultiplyEquals()
scalarMultiplyEquals(
scalar
):Point
Defined in: src/Point.ts:144
Multiplies this point by a value
Parameters
scalar
number
Returns
thisArg
Chainable
scalarSubtract()
scalarSubtract(
scalar
):Point
Defined in: src/Point.ts:102
Subtracts value from this point and returns a new one
Parameters
scalar
number
Returns
scalarSubtractEquals()
scalarSubtractEquals(
scalar
):Point
Defined in: src/Point.ts:113
Subtracts value from this point
Parameters
scalar
number
Returns
thisArg
Chainable
setFromPoint()
setFromPoint(
that
):Point
Defined in: src/Point.ts:324
Sets x/y of this point from another point
Parameters
that
Returns
Chainable
setX()
setX(
x
):Point
Defined in: src/Point.ts:304
Sets x of this point
Parameters
x
number
Returns
Chainable
setXY()
setXY(
x
,y
):Point
Defined in: src/Point.ts:293
Sets x/y of this point
Parameters
x
number
y
number
Returns
Chainable
setY()
setY(
y
):Point
Defined in: src/Point.ts:314
Sets y of this point
Parameters
y
number
Returns
Chainable
subtract()
subtract(
that
):Point
Defined in: src/Point.ts:80
Subtracts another point from this point and returns a new one
Parameters
that
Returns
new Point object with subtracted values
subtractEquals()
subtractEquals(
that
):Point
Defined in: src/Point.ts:91
Subtracts another point from this point
Parameters
that
Returns
thisArg
Chainable
swap()
swap(
that
):void
Defined in: src/Point.ts:334
Swaps x/y of this point and another point
Parameters
that
Returns
void
toString()
toString():
string
Defined in: src/Point.ts:283
Returns string representation of this point
Returns
string
transform()
transform(
t
,ignoreOffset
?):Point
Defined in: src/Point.ts:380
Apply transform t to point p
Parameters
t
The transform
ignoreOffset?
boolean
= false
Indicates that the offset should not be applied
Returns
The transformed point
Static
Member Of
fabric.util