Home > @jsplumbtoolkit/browser-ui > Surface > setZoomRange
Surface.setZoomRange() method
Sets the current zoom range. By default, this method checks if the current zoom is within the new range, and if it is not then setZoom
is called, which will cause the zoom to be clamped to an allowed value in the new range. You can disable this by passing true
for doNotClamp
.
Signature:
setZoomRange(zr: ZoomRange, doNotClamp?: boolean): ZoomRange;
Parameters
Parameter | Type | Description |
---|---|---|
zr | ZoomRange | New range, as an array consisting of [lower, upper] values. Lower must be less than upper. |
doNotClamp | boolean | If true, will not check the current zoom to ensure it falls within the new range. |
Returns:
Array of [min, max] current zoom values.