Skip to main content

Controlled zoom

Use can use customZoomLevel to pass a custom zoomLevel to the canvas and customStagePosition to move the stage position only when customZoomLevel > 1.

const [customStagePosition, setCustomStagePosition] = useState<  PointerPosition | undefined>()
const [customZoomLevel, setCustomZoomLevel] = useState(1)return (  <AnnotationViewer    /// other props    customZoomLevel={customZoomLevel}    customStagePosition={customStagePosition}  />)

Full example#