Skip to content

BlockSuite API Documentation / @blocksuite/blocks / Bound

Class: Bound ​

Contents ​

Implements ​

  • IBound

Constructors ​

new Bound(x, y, w, h) ​

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

Properties ​

h ​

h: number

Implementation of ​

IBound.h

Source ​

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


w ​

w: number

Implementation of ​

IBound.w

Source ​

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


x ​

x: number

Implementation of ​

IBound.x

Source ​

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


y ​

y: number

Implementation of ​

IBound.y

Source ​

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

Accessors ​

bl ​

get bl(): number[]

Returns ​

number[]

Source ​

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


br ​

get br(): number[]

Returns ​

number[]

Source ​

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


center ​

get center(): IVec

Returns ​

IVec

Source ​

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


horizontalLine ​

get horizontalLine(): IVec[]

Returns ​

IVec[]

Source ​

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


leftLine ​

get leftLine(): IVec[]

Returns ​

IVec[]

Source ​

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


lowerLine ​

get lowerLine(): IVec[]

Returns ​

IVec[]

Source ​

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


maxX ​

get maxX(): number

Returns ​

number

Source ​

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


maxY ​

get maxY(): number

Returns ​

number

Source ​

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


midPoints ​

get midPoints(): IVec[]

Returns ​

IVec[]

Source ​

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


minX ​

get minX(): number

Returns ​

number

Source ​

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


minY ​

get minY(): number

Returns ​

number

Source ​

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


points ​

get points(): IVec[]

Returns ​

IVec[]

Source ​

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


rightLine ​

get rightLine(): IVec[]

Returns ​

IVec[]

Source ​

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


tl ​

get tl(): IVec

Returns ​

IVec

Source ​

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


tr ​

get tr(): number[]

Returns ​

number[]

Source ​

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


upperLine ​

get upperLine(): IVec[]

Returns ​

IVec[]

Source ​

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


verticalLine ​

get verticalLine(): IVec[]

Returns ​

IVec[]

Source ​

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

Methods ​

clone() ​

clone(): Bound

Returns ​

Bound

Source ​

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


contains() ​

contains(bound): boolean

Parameters ​

• bound: Bound

Returns ​

boolean

Source ​

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


containsPoint() ​

containsPoint(__namedParameters): boolean

Parameters ​

• __namedParameters: IVec

Returns ​

boolean

Source ​

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


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


getRelativePoint() ​

getRelativePoint(__namedParameters): IVec

Parameters ​

• __namedParameters: IVec

Returns ​

IVec

Source ​

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


getVerticesAndMidpoints() ​

getVerticesAndMidpoints(): IVec[]

Returns ​

IVec[]

Source ​

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


horizontalDistance() ​

horizontalDistance(bound): number

Parameters ​

• bound: Bound

Returns ​

number

Source ​

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


include() ​

include(point): Bound

Parameters ​

• point: IVec

Returns ​

Bound

Source ​

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


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


isHorizontalCross() ​

isHorizontalCross(bound): boolean

Parameters ​

• bound: Bound

Returns ​

boolean

Source ​

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


isIntersectWithBound() ​

isIntersectWithBound(bound, epsilon): boolean

Parameters ​

• bound: Bound

• epsilon: number= EPSILON

Returns ​

boolean

Source ​

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


isOverlapWithBound() ​

isOverlapWithBound(bound, epsilon): boolean

Parameters ​

• bound: Bound

• epsilon: number= EPSILON

Returns ​

boolean

Source ​

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


isPointInBound() ​

isPointInBound(__namedParameters, tolerance): boolean

Parameters ​

• __namedParameters: IVec

• tolerance: number= 0.01

Returns ​

boolean

Source ​

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


isPointNearBound() ​

isPointNearBound(__namedParameters, tolerance): boolean

Parameters ​

• __namedParameters: IVec

• tolerance: number= 0.01

Returns ​

boolean

Source ​

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


isVerticalCross() ​

isVerticalCross(bound): boolean

Parameters ​

• bound: Bound

Returns ​

boolean

Source ​

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


serialize() ​

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

Returns ​

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

Source ​

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


toRelative() ​

toRelative(__namedParameters): IVec

Parameters ​

• __namedParameters: IVec

Returns ​

IVec

Source ​

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


unite() ​

unite(bound): Bound

Parameters ​

• bound: Bound

Returns ​

Bound

Source ​

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


verticalDistance() ​

verticalDistance(bound): number

Parameters ​

• bound: Bound

Returns ​

number

Source ​

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


deserialize() ​

static deserialize(s): Bound

Parameters ​

• s: string

Returns ​

Bound

Source ​

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


from() ​

static from(arg1): Bound

Parameters ​

• arg1: IBound

Returns ​

Bound

Source ​

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


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


fromDOMRect() ​

static fromDOMRect(__namedParameters): Bound

Parameters ​

• __namedParameters: DOMRect

Returns ​

Bound

Source ​

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


fromPoints() ​

static fromPoints(points): Bound

Parameters ​

• points: IVec[]

Returns ​

Bound

Source ​

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


fromXYWH() ​

static fromXYWH(xywh): Bound

Parameters ​

• xywh: XYWH

Returns ​

Bound

Source ​

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


Generated using typedoc-plugin-markdown and TypeDoc