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 ​
get
bl():number
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:92
br ​
get
br():number
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:96
center ​
get
center():IVec
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:64
horizontalLine ​
get
horizontalLine():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:107
leftLine ​
get
leftLine():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:128
lowerLine ​
get
lowerLine():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:121
maxX ​
get
maxX():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:76
maxY ​
get
maxY():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:80
midPoints ​
get
midPoints():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:55
minX ​
get
minX():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:68
minY ​
get
minY():number
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:72
points ​
get
points():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:46
rightLine ​
get
rightLine():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:135
tl ​
get
tl():IVec
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:84
tr ​
get
tr():number
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:88
upperLine ​
get
upperLine():IVec
[]
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:114
verticalLine ​
get
verticalLine():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 ​
static
deserialize(s
):Bound
Parameters ​
Parameter | Type |
---|---|
s | string |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:281
from ​
static
from(arg1
):Bound
Parameters ​
Parameter | Type |
---|---|
arg1 | IBound |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:28
fromCenter ​
static
fromCenter(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 ​
static
fromDOMRect(__namedParameters
):Bound
Parameters ​
Parameter | Type |
---|---|
__namedParameters | DOMRect |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:32
fromPoints ​
static
fromPoints(points
):Bound
Parameters ​
Parameter | Type |
---|---|
points | IVec [] |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:36
fromXYWH ​
static
fromXYWH(xywh
):Bound
Parameters ​
Parameter | Type |
---|---|
xywh | XYWH |
Returns ​
Defined In ​
packages/blocks/src/surface-block/utils/bound.ts:24