Skip to content

Commit

Permalink
[REFACTOR] Use the new Navigation API to perform fit (#345)
Browse files Browse the repository at this point in the history
In [email protected], the oldest `fit` API is deprecated so prepare the future.
  • Loading branch information
tbouffard authored May 30, 2022
1 parent 251a6fc commit 5648236
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function performFit(type) {
}

// `type` and `margin` are optional. Moreover, `margin` is only considered when FitType is not None.
bpmnVisualization.fit({type: fitType, margin: fitMargin});
bpmnVisualization.navigation.fit({type: fitType, margin: fitMargin});
}

// 'Fit Margin' dropdown list
Expand Down
2 changes: 1 addition & 1 deletion examples/diagram-navigation/diagram-navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bpmnVisualization.load(getNavigationBpmnDiagram());

let displayScrollBars = false;
document.getElementById('btn-reset').onclick = function () {
bpmnVisualization.fit({ type: bpmnvisu.FitType.None });
bpmnVisualization.navigation.fit({ type: bpmnvisu.FitType.None });

// reset scrollbars position
displayScrollBars && bpmnContainer.scrollTo(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/compare-with-bpmn-js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class LibraryComparator {
}

_setZoomLevelBpmnVisualization() {
this.#bpmnVisualization.fit(this._computeBpmnVisualizationFitOptions());
this.#bpmnVisualization.navigation.fit(this._computeBpmnVisualizationFitOptions());
this._logBpmnVisualization(`Zoom level set, fitView ${this._state.fitView}`);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/overlays/add-stylized/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ document.getElementById('btn-set-overlay').onclick = () => {

document.getElementById('btn-reset').onclick = () => {
removeAllOverlays();
bpmnVisualization.fit({ type: 'Center' });
bpmnVisualization.navigation.fit({ type: 'Center' });
};

0 comments on commit 5648236

Please sign in to comment.