zoomToFit method

void zoomToFit()

This command changes the Diagram#scale so that the Diagram#documentBounds fits within the viewport. If this command had been called before without any other zooming since then, the original Diagram scale and position are restored. This is normally invoked by the Shift-Z keyboard shortcut. If you do not want the behavior where this command might restore the original diagram scale and position on a subsequent call, set #isZoomToFitRestoreEnabled to false.

As of 2.1, this animates zooming by default. Diagram#zoomToFit does not animate.

This method may be overridden, but you should consider calling this base method in order to get all of its functionality. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @see #canZoomToFit @see #isZoomToFitRestoreEnabled @since 1.1

Implementation

void zoomToFit() {
  _i4.callMethod(
    this,
    'zoomToFit',
    [],
  );
}