Skip to content

API > @blocksuite/blocks > SurfaceViewport

Interface: SurfaceViewport ​

Properties ​

boundingClientRect ​

readonly boundingClientRect: DOMRect

Defined In ​

packages/blocks/src/surface-block/renderer.ts:27


center ​

readonly center: IPoint

Defined In ​

packages/blocks/src/surface-block/renderer.ts:18


centerX ​

readonly centerX: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:19


centerY ​

readonly centerY: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:20


height ​

readonly height: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:17


left ​

readonly left: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:14


top ​

readonly top: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:15


viewportBounds ​

readonly viewportBounds: Bound

Defined In ​

packages/blocks/src/surface-block/renderer.ts:26


viewportMaxXY ​

readonly viewportMaxXY: IPoint

Defined In ​

packages/blocks/src/surface-block/renderer.ts:25


viewportMinXY ​

readonly viewportMinXY: IPoint

Defined In ​

packages/blocks/src/surface-block/renderer.ts:24


viewportX ​

readonly viewportX: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:22


viewportY ​

readonly viewportY: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:23


width ​

readonly width: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:16


zoom ​

readonly zoom: number

Defined In ​

packages/blocks/src/surface-block/renderer.ts:21

Methods ​

addOverlay ​

addOverlay(overlay): void

Parameters ​

ParameterType
overlayOverlay

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/renderer.ts:37


applyDeltaCenter ​

applyDeltaCenter(deltaX, deltaY): void

Parameters ​

ParameterType
deltaXnumber
deltaYnumber

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/renderer.ts:34


getCanvasByBound ​

getCanvasByBound(bound, surfaceElements?): HTMLCanvasElement

Parameters ​

ParameterType
boundIBound
surfaceElements?SurfaceElement< ISurfaceElement, ISurfaceElementLocalRecord >[]

Returns ​

HTMLCanvasElement

Defined In ​

packages/blocks/src/surface-block/renderer.ts:40


isInViewport ​

isInViewport(bound): boolean

Parameters ​

ParameterType
boundBound

Returns ​

boolean

Defined In ​

packages/blocks/src/surface-block/renderer.ts:35


removeOverlay ​

removeOverlay(overlay): void

Parameters ​

ParameterType
overlayOverlay

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/renderer.ts:38


setCenter ​

setCenter(centerX, centerY): void

Parameters ​

ParameterType
centerXnumber
centerYnumber

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/renderer.ts:32


setZoom ​

setZoom(zoom, focusPoint?): void

Parameters ​

ParameterType
zoomnumber
focusPoint?IPoint

Returns ​

void

Defined In ​

packages/blocks/src/surface-block/renderer.ts:33


toModelCoord ​

toModelCoord(viewX, viewY): [number, number]

Parameters ​

ParameterType
viewXnumber
viewYnumber

Returns ​

[number, number]

Defined In ​

packages/blocks/src/surface-block/renderer.ts:29


toViewCoord ​

toViewCoord(logicalX, logicalY): [number, number]

Parameters ​

ParameterType
logicalXnumber
logicalYnumber

Returns ​

[number, number]

Defined In ​

packages/blocks/src/surface-block/renderer.ts:30