Skip to content

BlockSuite API Documentation / @blocksuite/affine-block-surface / ConnectionOverlay

Class: ConnectionOverlay

An overlay is a layer covered on top of elements, can be used for rendering non-CRDT state indicators.

Extends

Constructors

new ConnectionOverlay()

new ConnectionOverlay(gfx): ConnectionOverlay

Parameters

gfx

GfxController

Returns

ConnectionOverlay

Overrides

Overlay.constructor

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:833

Properties

_renderer

protected _renderer: null | CanvasRenderer = null

Inherited from

Overlay._renderer

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:19


gfx

protected gfx: GfxController

Inherited from

Overlay.gfx

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:21


highlightPoint

highlightPoint: null | IVec = null

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:825


points

points: IVec[] = []

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:827


sourceBounds

sourceBounds: null | IBound = null

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:829


targetBounds

targetBounds: null | IBound = null

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:831


overlayName

static overlayName: string = 'connection'

Overrides

Overlay.overlayName

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:823

Methods

_clearRect()

_clearRect(): void

Returns

void

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:843


clear()

clear(): void

Returns

void

Overrides

Overlay.clear

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:849


refresh()

refresh(): void

Returns

void

Inherited from

Overlay.refresh

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:40


render()

render(ctx): void

Parameters

ctx

CanvasRenderingContext2D

Returns

void

Overrides

Overlay.render

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:855


renderConnector()

renderConnector(point, excludedIds): Connection

Render the connector at the given point. It will try to find the closest connectable element and render the connector. If the point is not close to any connectable element, it will just render the connector at the given point.

Parameters

point

IVec

the point to render the connector

excludedIds

string[] = []

the ids of the elements that should be excluded

Returns

Connection

the connection result

Defined in

packages/affine/block-surface/src/managers/connector-manager.ts:905


setRenderer()

setRenderer(renderer): void

Parameters

renderer

null | CanvasRenderer

Returns

void

Inherited from

Overlay.setRenderer

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:48


setup()

static setup(di): void

Parameters

di

Container

Returns

void

Inherited from

Overlay.setup

Defined in

packages/affine/block-surface/src/renderer/overlay.ts:25