Home > @jsplumbtoolkit/browser-ui > Surface > setZoom
Surface.setZoom() method
Sets the current zoom, clamping it to the allowed range.
Signature:
setZoom(zoom: number, animate?: boolean): number;
Parameters
Parameter | Type | Description |
---|---|---|
zoom | number | Zoom value. If this is outside the allowed bounds it will be clamped. |
animate | boolean | If true, the surface will animate the transition in zoom by stepping through several intermediate levels in succession. |
Returns:
number
Current zoom. This may or may not be the value you asked for - it might have been clamped to the current allowed zoom range.