BlockSuite API Documentation / @blocksuite/blocks / Viewport
Class: Viewport
Constructors
new Viewport(undefined)
new Viewport():
Viewport
Returns
Properties
_center
protected
_center:IPoint
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:24
_el
protected
_el:HTMLElement
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:27
_height
protected
_height:number
=0
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:23
_left
protected
_left:number
=0
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:20
_rafId
protected
_rafId:null
|number
=null
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:26
_syncFlag
private
_syncFlag:boolean
=false
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:28
_top
protected
_top:number
=0
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:21
_width
protected
_width:number
=0
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:22
_zoom
protected
_zoom:number
=1.0
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:25
sizeUpdated
sizeUpdated:
Slot
<Object
>
Type declaration
height
height:
number
left
left:
number
top
top:
number
width
width:
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:31
viewportUpdated
viewportUpdated:
Slot
<Object
>
Type declaration
center
center:
IVec2
zoom
zoom:
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:30
Accessors
boundingClientRect
get
boundingClientRect():DOMRect
Returns
DOMRect
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:113
center
get
center():IPoint
Returns
IPoint
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:62
centerX
get
centerX():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:54
centerY
get
centerY():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:58
height
get
height():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:50
left
get
left():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:38
top
get
top():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:42
translateX
get
translateX():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:80
translateY
get
translateY():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:84
viewportBounds
get
viewportBounds():Bound
Returns
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:104
viewportMaxXY
get
viewportMaxXY():Object
Returns
Object
x
x:
number
y
y:
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:96
viewportMinXY
get
viewportMinXY():Object
Returns
Object
x
x:
number
y
y:
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:88
viewportX
get
viewportX():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:70
viewportY
get
viewportY():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:75
width
get
width():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:46
zoom
get
zoom():number
Returns
number
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:66
Methods
applyDeltaCenter()
applyDeltaCenter(
deltaX
,deltaY
):void
Parameters
• deltaX: number
• deltaY: number
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:181
dispose()
dispose():
void
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:330
isInViewport()
isInViewport(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:185
onResize()
onResize():
void
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:117
setCenter()
setCenter(
centerX
,centerY
):void
Parameters
• centerX: number
• centerY: number
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:154
setContainer()
setContainer(
container
):void
Parameters
• container: HTMLElement
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:129
setRect()
setRect(
left
,top
,width
,height
):void
Parameters
• left: number
• top: number
• width: number
• height: number
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:237
setViewport()
setViewport(
newZoom
,newCenter
,smooth
):void
Parameters
• newZoom: number
• newCenter: number
[]= undefined
• smooth: boolean
= false
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:193
setViewportByBound()
setViewportByBound(
bound
,padding
,smooth
):void
Parameters
• bound: Bound
• padding: [number
, number
, number
, number
]= undefined
• smooth: boolean
= false
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:218
setZoom()
setZoom(
zoom
,focusPoint
?):void
Parameters
• zoom: number
• focusPoint?: IPoint
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:163
smoothTranslate()
smoothTranslate(
x
,y
):void
Parameters
• x: number
• y: number
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:268
smoothZoom()
smoothZoom(
zoom
,focusPoint
?):void
Parameters
• zoom: number
• focusPoint?: IPoint
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:250
sync()
sync(
viewport
): () =>void
Parameters
• viewport: Viewport
Returns
Function
Returns
void
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:291
toModelCoord()
toModelCoord(
viewX
,viewY
): [number
,number
]
Parameters
• viewX: number
• viewY: number
Returns
[number
, number
]
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:137
toViewBound()
toViewBound(
bound
):Bound
Parameters
• bound: Bound
Returns
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:147
toViewCoord()
toViewCoord(
modelX
,modelY
): [number
,number
]
Parameters
• modelX: number
• modelY: number
Returns
[number
, number
]
Source
packages/blocks/src/page-block/edgeless/utils/viewport.ts:142
Generated using TypeDoc and typedoc-plugin-markdown.