File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -139,14 +139,26 @@ export default {
139139 },
140140 async exportPNG () {
141141 await this .withSelectionCleared (() => {
142- this .graph .exportPNG (` ${ this .diagram .title } .png` , {
143- padding: 50
144- });
142+ const currentZoom = this .graph .zoom ();
143+ try {
144+ this .graph .zoomTo (1 );
145+ this .graph .exportPNG (` ${ this .diagram .title } .png` , {
146+ padding: 50
147+ });
148+ }finally {
149+ this .graph .zoomTo (currentZoom);
150+ }
145151 });
146152 },
147153 async exportSVG () {
148154 await this .withSelectionCleared (() => {
149- this .graph .exportSVG (` ${ this .diagram .title } .svg` );
155+ const currentZoom = this .graph .zoom ();
156+ try {
157+ this .graph .zoomTo (1 );
158+ this .graph .exportSVG (` ${ this .diagram .title } .svg` );
159+ }finally {
160+ this .graph .zoomTo (currentZoom);
161+ }
150162 });
151163 },
152164 async withSelectionCleared (fn ) {
You can’t perform that action at this time.
0 commit comments