Playground
Canvas instance
config
Canvas configuration, provides zoom, scroll, etc.
updateConfig
- zoom
numberCurrent zoom ratio - scrollX
- scrollY
- minZoom
- maxZoom
- readonly
- disabled
- width
- height
fitView
Node fit canvas window, need to pass in the node's bounds
scrollToView
Specify the node position and scroll to the canvas visible area, if the position is already in the visible area, it will not scroll unless scrollToCenter is forced to scroll
zoomin
Zoom In
zoomout
Zoom Out
getPoseFromMouseEvent
Convert browser mouse position to canvas coordinate system
scroll
Scroll canvas, need to pass in the scroll position, and whether to smooth scroll, scroll time
isViewportVisible
Determine whether the current node is within the viewport