Skip to main content

Home > @jsplumbtoolkit/browser-ui > Surface > zoomToFitIfNecessary

Surface.zoomToFitIfNecessary() method#

Zooms the display so that all the tracked elements fit inside the viewport, but does not make any adjustments to zoom if all the elements are currently visible (it still does center the content though).

Signature:

zoomToFitIfNecessary(params: {        padding?: number;        fill?: number;        onComplete?: Function;        onStep?: Function;        doNotAnimate?: boolean;    }): void;

Parameters#

ParameterTypeDescription
params{ padding?: number; fill?: number; onComplete?: Function; onStep?: Function; doNotAnimate?: boolean; }

Returns:

void