Skip to main content

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): void;

Parameters#

ParameterTypeDescription
zoomnumberZoom value. If this is outside the allowed bounds it will be clamped.
animatebooleanIf true, the surface will animate the transition in zoom by stepping through several intermediate levels in succession.

Returns:

void

Current zoom. This may or may not be the value you asked for - it might have been clamped to the current allowed zoom range.