Zoom to fit viewport when opening a diagram.
This commit is contained in:
parent
5fbe08d3cd
commit
653d15acf3
|
@ -450,7 +450,10 @@ export default function ReactDiagramEditor({
|
||||||
if (alreadyImportedXmlRef.current) {
|
if (alreadyImportedXmlRef.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
diagramModelerToUse.importXML(diagramXMLToDisplay);
|
diagramModelerToUse.importXML(diagramXMLToDisplay).then(() => {
|
||||||
|
diagramModelerToUse.get('canvas').zoom('fit-viewport');
|
||||||
|
});
|
||||||
|
|
||||||
alreadyImportedXmlRef.current = true;
|
alreadyImportedXmlRef.current = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue