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