From 87dd8f7dc3c8646555a34d54ad3568730458867a Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Mon, 23 Mar 2020 13:01:31 -0400 Subject: [PATCH] Prevents canvas bug. --- src/app/diagram/diagram.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/diagram/diagram.component.ts b/src/app/diagram/diagram.component.ts index ac8f2a1..117da0d 100644 --- a/src/app/diagram/diagram.component.ts +++ b/src/app/diagram/diagram.component.ts @@ -206,7 +206,11 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { this.modeler.on('import.done', ({error}) => { if (!error) { - this.modeler.getActiveViewer().get('canvas').zoom('fit-viewport'); + const activeView = this.modeler.getActiveView(); + if (activeView.type === 'drd') { + this.modeler.getActiveViewer().get('canvas').zoom('fit-viewport'); + } + window.scrollTo({ top: 0, left: 0,