API > @blocksuite/blocks > Point
Class: Point ​
Constructors ​
constructor ​
new Point(
x
=0
,y
=0
):Point
Parameters ​
Parameter | Type | Default value |
---|---|---|
x | number | 0 |
y | number | 0 |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:8
Properties ​
x ​
x:
number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:5
y ​
y:
number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:6
Methods ​
add ​
add(
point
):Point
Parameters ​
Parameter | Type |
---|---|
point | IPoint |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:32
clone ​
clone():
Point
Returns a copy of the point.
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:47
cross ​
cross(
point
):number
Parameters ​
Parameter | Type |
---|---|
point | IPoint |
Returns ​
number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:51
equals ​
equals(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Point |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:28
lerp ​
lerp(
point
,t
):Point
Parameters ​
Parameter | Type |
---|---|
point | IPoint |
t | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:55
scale ​
scale(
factor
):Point
Parameters ​
Parameter | Type |
---|---|
factor | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:36
set ​
set(
x
,y
):void
Parameters ​
Parameter | Type |
---|---|
x | number |
y | number |
Returns ​
void
Defined In ​
packages/blocks/src/_common/utils/rect.ts:23
subtract ​
subtract(
point
):Point
Parameters ​
Parameter | Type |
---|---|
point | IPoint |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:40
toArray ​
toArray():
number
[]
Returns ​
number
[]
Defined In ​
packages/blocks/src/_common/utils/rect.ts:62
clamp ​
static
clamp(p
,min
,max
):Point
Restrict a value to a certain interval.
Parameters ​
Parameter | Type |
---|---|
p | Point |
min | Point |
max | Point |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:83
from ​
static
from(point
,y
?):Point
Parameters ​
Parameter | Type |
---|---|
point | number | number [] | IPoint |
y ? | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:13
max ​
static
max(a
,b
):Point
Compares and returns the maximum of two points.
Parameters ​
Parameter | Type |
---|---|
a | Point |
b | Point |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:76
min ​
static
min(a
,b
):Point
Compares and returns the minimum of two points.
Parameters ​
Parameter | Type |
---|---|
a | Point |
b | Point |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:69