BlockSuite API Documentation / @blocksuite/blocks / Bound
Class: Bound
Implements
IBound
Constructors
new Bound()
new Bound(
x
,y
,w
,h
):Bound
Parameters
• x: number
= 0
• y: number
= 0
• w: number
= 0
• h: number
= 0
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:128
Properties
h
h:
number
Implementation of
IBound.h
Source
packages/blocks/src/surface-block/utils/bound.ts:126
w
w:
number
Implementation of
IBound.w
Source
packages/blocks/src/surface-block/utils/bound.ts:124
x
x:
number
Implementation of
IBound.x
Source
packages/blocks/src/surface-block/utils/bound.ts:120
y
y:
number
Implementation of
IBound.y
Source
packages/blocks/src/surface-block/utils/bound.ts:122
Accessors
bl
get
bl():number
[]
Returns
number
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:70
br
get
br():number
[]
Returns
number
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:74
center
get
center():IVec
set
center(__namedParameters
):void
Parameters
• __namedParameters: IVec
Returns
IVec
Source
packages/blocks/src/surface-block/utils/bound.ts:36
horizontalLine
get
horizontalLine():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:85
leftLine
get
leftLine():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:106
lowerLine
get
lowerLine():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:99
maxX
get
maxX():number
Returns
number
Source
packages/blocks/src/surface-block/utils/bound.ts:54
maxY
get
maxY():number
Returns
number
Source
packages/blocks/src/surface-block/utils/bound.ts:58
midPoints
get
midPoints():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:27
minX
get
minX():number
Returns
number
Source
packages/blocks/src/surface-block/utils/bound.ts:46
minY
get
minY():number
Returns
number
Source
packages/blocks/src/surface-block/utils/bound.ts:50
points
get
points():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:18
rightLine
get
rightLine():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:113
tl
get
tl():IVec
Returns
IVec
Source
packages/blocks/src/surface-block/utils/bound.ts:62
tr
get
tr():number
[]
Returns
number
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:66
upperLine
get
upperLine():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:92
verticalLine
get
verticalLine():IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:78
Methods
clone()
clone():
Bound
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:202
contains()
contains(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:255
containsPoint()
containsPoint(
__namedParameters
):boolean
Parameters
• __namedParameters: IVec
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:135
expand()
expand(
left
,top
,right
,bottom
):Bound
Parameters
• left: number
• top: number
= left
• right: number
= left
• bottom: number
= top
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:228
getRelativePoint()
getRelativePoint(
__namedParameters
):IVec
Parameters
• __namedParameters: IVec
Returns
IVec
Source
packages/blocks/src/surface-block/utils/bound.ts:190
getVerticesAndMidpoints()
getVerticesAndMidpoints():
IVec
[]
Returns
IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:264
horizontalDistance()
horizontalDistance(
bound
):number
Parameters
• bound: Bound
Returns
number
Source
packages/blocks/src/surface-block/utils/bound.ts:214
include()
include(
point
):Bound
Parameters
• point: IVec
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:182
intersectLine()
intersectLine(
sp
,ep
,infinite
):null
|IVec
[]
Parameters
• sp: IVec
• ep: IVec
• infinite: boolean
= false
Returns
null
| IVec
[]
Source
packages/blocks/src/surface-block/utils/bound.ts:140
isHorizontalCross()
isHorizontalCross(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:206
isIntersectWithBound()
isIntersectWithBound(
bound
,epsilon
):boolean
Parameters
• bound: Bound
• epsilon: number
= EPSILON
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:154
isOverlapWithBound()
isOverlapWithBound(
bound
,epsilon
):boolean
Parameters
• bound: Bound
• epsilon: number
= EPSILON
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:165
isPointInBound()
isPointInBound(
__namedParameters
,tolerance
):boolean
Parameters
• __namedParameters: IVec
• tolerance: number
= 0.01
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:242
isPointNearBound()
isPointNearBound(
__namedParameters
,tolerance
):boolean
Parameters
• __namedParameters: IVec
• tolerance: number
= 0.01
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:251
isVerticalCross()
isVerticalCross(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Source
packages/blocks/src/surface-block/utils/bound.ts:210
serialize()
serialize(): `[${number},${number},${number},${number}]`
Returns
`[${number},${number},${number},${number}]`
Source
packages/blocks/src/surface-block/utils/bound.ts:198
toRelative()
toRelative(
__namedParameters
):IVec
Parameters
• __namedParameters: IVec
Returns
IVec
Source
packages/blocks/src/surface-block/utils/bound.ts:194
toXYWH()
toXYWH():
XYWH
Returns
XYWH
Source
packages/blocks/src/surface-block/utils/bound.ts:268
unite()
unite(
bound
):Bound
Parameters
• bound: Bound
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:174
verticalDistance()
verticalDistance(
bound
):number
Parameters
• bound: Bound
Returns
number
Source
packages/blocks/src/surface-block/utils/bound.ts:221
deserialize()
static
deserialize(s
):Bound
Parameters
• s: string
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:272
from()
static
from(arg1
):Bound
Parameters
• arg1: IBound
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:285
fromCenter()
static
fromCenter(center
,width
,height
):Bound
Parameters
• center: IVec
• width: number
• height: number
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:298
fromDOMRect()
static
fromDOMRect(__namedParameters
):Bound
Parameters
• __namedParameters: DOMRect
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:289
fromPoints()
static
fromPoints(points
):Bound
Parameters
• points: IVec
[]
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:293
fromXYWH()
static
fromXYWH(xywh
):Bound
Parameters
• xywh: XYWH
Returns
Source
packages/blocks/src/surface-block/utils/bound.ts:281
serialize()
static
serialize(bound
): `[${number},${number},${number},${number}]`
Parameters
• bound: IBound
Returns
`[${number},${number},${number},${number}]`
Source
packages/blocks/src/surface-block/utils/bound.ts:277