Skip to content

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

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:23

Properties

h

h: number

Implementation of

IBound.h

Source

packages/blocks/src/surface-block/utils/bound.ts:21


w

w: number

Implementation of

IBound.w

Source

packages/blocks/src/surface-block/utils/bound.ts:20


x

x: number

Implementation of

IBound.x

Source

packages/blocks/src/surface-block/utils/bound.ts:18


y

y: number

Implementation of

IBound.y

Source

packages/blocks/src/surface-block/utils/bound.ts:19

Accessors

bl

get bl(): number[]

Returns

number[]

Source

packages/blocks/src/surface-block/utils/bound.ts:98


br

get br(): number[]

Returns

number[]

Source

packages/blocks/src/surface-block/utils/bound.ts:102


center

get center(): IVec

Returns

IVec

Source

packages/blocks/src/surface-block/utils/bound.ts:70


horizontalLine

get horizontalLine(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:113


leftLine

get leftLine(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:134


lowerLine

get lowerLine(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:127


maxX

get maxX(): number

Returns

number

Source

packages/blocks/src/surface-block/utils/bound.ts:82


maxY

get maxY(): number

Returns

number

Source

packages/blocks/src/surface-block/utils/bound.ts:86


midPoints

get midPoints(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:61


minX

get minX(): number

Returns

number

Source

packages/blocks/src/surface-block/utils/bound.ts:74


minY

get minY(): number

Returns

number

Source

packages/blocks/src/surface-block/utils/bound.ts:78


points

get points(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:52


rightLine

get rightLine(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:141


tl

get tl(): IVec

Returns

IVec

Source

packages/blocks/src/surface-block/utils/bound.ts:90


tr

get tr(): number[]

Returns

number[]

Source

packages/blocks/src/surface-block/utils/bound.ts:94


upperLine

get upperLine(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:120


verticalLine

get verticalLine(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:106

Methods

clone()

clone(): Bound

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:215


contains()

contains(bound): boolean

Parameters

bound: Bound

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:268


containsPoint()

containsPoint(__namedParameters): boolean

Parameters

__namedParameters: IVec

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:148


expand()

expand(left, top, right, bottom): Bound

Parameters

left: number

top: number= left

right: number= left

bottom: number= top

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:241


getRelativePoint()

getRelativePoint(__namedParameters): IVec

Parameters

__namedParameters: IVec

Returns

IVec

Source

packages/blocks/src/surface-block/utils/bound.ts:203


getVerticesAndMidpoints()

getVerticesAndMidpoints(): IVec[]

Returns

IVec[]

Source

packages/blocks/src/surface-block/utils/bound.ts:277


horizontalDistance()

horizontalDistance(bound): number

Parameters

bound: Bound

Returns

number

Source

packages/blocks/src/surface-block/utils/bound.ts:227


include()

include(point): Bound

Parameters

point: IVec

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:195


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:153


isHorizontalCross()

isHorizontalCross(bound): boolean

Parameters

bound: Bound

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:219


isIntersectWithBound()

isIntersectWithBound(bound, epsilon): boolean

Parameters

bound: Bound

epsilon: number= EPSILON

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:167


isOverlapWithBound()

isOverlapWithBound(bound, epsilon): boolean

Parameters

bound: Bound

epsilon: number= EPSILON

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:178


isPointInBound()

isPointInBound(__namedParameters, tolerance): boolean

Parameters

__namedParameters: IVec

tolerance: number= 0.01

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:255


isPointNearBound()

isPointNearBound(__namedParameters, tolerance): boolean

Parameters

__namedParameters: IVec

tolerance: number= 0.01

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:264


isVerticalCross()

isVerticalCross(bound): boolean

Parameters

bound: Bound

Returns

boolean

Source

packages/blocks/src/surface-block/utils/bound.ts:223


serialize()

serialize(): `[${number},${number},${number},${number}]`

Returns

`[${number},${number},${number},${number}]`

Source

packages/blocks/src/surface-block/utils/bound.ts:211


toRelative()

toRelative(__namedParameters): IVec

Parameters

__namedParameters: IVec

Returns

IVec

Source

packages/blocks/src/surface-block/utils/bound.ts:207


unite()

unite(bound): Bound

Parameters

bound: Bound

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:187


verticalDistance()

verticalDistance(bound): number

Parameters

bound: Bound

Returns

number

Source

packages/blocks/src/surface-block/utils/bound.ts:234


deserialize()

static deserialize(s): Bound

Parameters

s: string

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:281


from()

static from(arg1): Bound

Parameters

arg1: IBound

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:34


fromCenter()

static fromCenter(center, width, height): Bound

Parameters

center: IVec

width: number

height: number

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:47


fromDOMRect()

static fromDOMRect(__namedParameters): Bound

Parameters

__namedParameters: DOMRect

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:38


fromPoints()

static fromPoints(points): Bound

Parameters

points: IVec[]

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:42


fromXYWH()

static fromXYWH(xywh): Bound

Parameters

xywh: XYWH

Returns

Bound

Source

packages/blocks/src/surface-block/utils/bound.ts:30