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?: (p: PointXY) => any;
onStep?: () => any;
doNotAnimate?: boolean;
}): void;

Parameters

ParameterTypeDescription
params{ padding?: number; fill?: number; onComplete?: (p: PointXY) => any; onStep?: () => any; doNotAnimate?: boolean; }

Returns:

void