API > @blocksuite/blocks > Bound
Class: Bound ​
Implements ​
Constructors ​
constructor ​
new Bound(
x=0,y=0,w=0,h=0):Bound
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
x | number | 0 |
y | number | 0 |
w | number | 0 |
h | number | 0 |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:17
Properties ​
h ​
h:
number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:15
Implementation of ​
w ​
w:
number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:14
Implementation of ​
x ​
x:
number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:12
Implementation of ​
y ​
y:
number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:13
Implementation of ​
Accessors ​
bl ​
getbl():number[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:92
br ​
getbr():number[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:96
center ​
getcenter():IVec
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:64
horizontalLine ​
gethorizontalLine():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:107
leftLine ​
getleftLine():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:128
lowerLine ​
getlowerLine():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:121
maxX ​
getmaxX():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:76
maxY ​
getmaxY():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:80
midPoints ​
getmidPoints():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:55
minX ​
getminX():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:68
minY ​
getminY():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:72
points ​
getpoints():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:46
rightLine ​
getrightLine():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:135
tl ​
gettl():IVec
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:84
tr ​
gettr():number[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:88
upperLine ​
getupperLine():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:114
verticalLine ​
getverticalLine():IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:100
Methods ​
clone ​
clone():
Bound
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:209
contains ​
contains(
bound):boolean
Parameters ​
| Parameter | Type |
|---|---|
bound | Bound |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:268
containsPoint ​
containsPoint(
__namedParameters):boolean
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | IVec |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:142
expand ​
expand(
left,top=left,right=left,bottom=top):Bound
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
left | number | undefined |
top | number | left |
right | number | left |
bottom | number | top |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:235
getRelativePoint ​
getRelativePoint(
__namedParameters):IVec
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | IVec |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:197
getVerticesAndMidpoints ​
getVerticesAndMidpoints():
IVec[]
Returns ​
IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:277
horizontalDistance ​
horizontalDistance(
bound):number
Parameters ​
| Parameter | Type |
|---|---|
bound | Bound |
Returns ​
number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:221
include ​
include(
point):Bound
Parameters ​
| Parameter | Type |
|---|---|
point | IVec |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:189
intersectLine ​
intersectLine(
sp,ep,infinite=false):null|IVec[]
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
sp | IVec | undefined |
ep | IVec | undefined |
infinite | boolean | false |
Returns ​
null | IVec[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:147
isHorizontalCross ​
isHorizontalCross(
bound):boolean
Parameters ​
| Parameter | Type |
|---|---|
bound | Bound |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:213
isIntersectWithBound ​
isIntersectWithBound(
bound,epsilon=EPSILON):boolean
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
bound | Bound | undefined |
epsilon | number | EPSILON |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:161
isOverlapWithBound ​
isOverlapWithBound(
bound,epsilon=EPSILON):boolean
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
bound | Bound | undefined |
epsilon | number | EPSILON |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:172
isPointInBound ​
isPointInBound(
__namedParameters,tolerance=0.01):boolean
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
__namedParameters | IVec | undefined |
tolerance | number | 0.01 |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:249
isPointOnBound ​
isPointOnBound(
__namedParameters,tolerance=4):boolean
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
__namedParameters | IVec | undefined |
tolerance | number | 4 |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:258
isVerticalCross ​
isVerticalCross(
bound):boolean
Parameters ​
| Parameter | Type |
|---|---|
bound | Bound |
Returns ​
boolean
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:217
serialize ​
serialize(): `[${number},${number},${number},${number}]`
Returns ​
`[${number},${number},${number},${number}]`
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:205
toRelative ​
toRelative(
__namedParameters):IVec
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | IVec |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:201
unite ​
unite(
bound):Bound
Parameters ​
| Parameter | Type |
|---|---|
bound | Bound |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:181
verticalDistance ​
verticalDistance(
bound):number
Parameters ​
| Parameter | Type |
|---|---|
bound | Bound |
Returns ​
number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:228
deserialize ​
staticdeserialize(s):Bound
Parameters ​
| Parameter | Type |
|---|---|
s | string |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:281
from ​
staticfrom(arg1):Bound
Parameters ​
| Parameter | Type |
|---|---|
arg1 | IBound |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:28
fromCenter ​
staticfromCenter(center,width,height):Bound
Parameters ​
| Parameter | Type |
|---|---|
center | IVec |
width | number |
height | number |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:41
fromDOMRect ​
staticfromDOMRect(__namedParameters):Bound
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | DOMRect |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:32
fromPoints ​
staticfromPoints(points):Bound
Parameters ​
| Parameter | Type |
|---|---|
points | IVec[] |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:36
fromXYWH ​
staticfromXYWH(xywh):Bound
Parameters ​
| Parameter | Type |
|---|---|
xywh | XYWH |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:24