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