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
Overrides
Defined in
packages/affine/block-surface/src/managers/connector-manager.ts:833
Properties
_renderer
protected
_renderer:null
|CanvasRenderer
=null
Inherited from
Defined in
packages/affine/block-surface/src/renderer/overlay.ts:19
gfx
protected
gfx:GfxController
Inherited from
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
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
Defined in
packages/affine/block-surface/src/managers/connector-manager.ts:849
refresh()
refresh():
void
Returns
void
Inherited from
Defined in
packages/affine/block-surface/src/renderer/overlay.ts:40
render()
render(
ctx
):void
Parameters
ctx
CanvasRenderingContext2D
Returns
void
Overrides
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
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
Defined in
packages/affine/block-surface/src/renderer/overlay.ts:48
setup()
static
setup(di
):void
Parameters
di
Container
Returns
void
Inherited from
Defined in
packages/affine/block-surface/src/renderer/overlay.ts:25