@@ -33187,7 +33187,7 @@ OG.graph.Canvas.prototype = {
3318733187 }
3318833188 ,
3318933189 updateSlider: function (val) {
33190- if(this._CONFIG.AUTO_SLIDER_UPDATE){
33190+ if (this._CONFIG.AUTO_SLIDER_UPDATE) {
3319133191 var me = this;
3319233192 if (!this._CONFIG.SLIDER) {
3319333193 return;
@@ -34235,15 +34235,18 @@ OG.graph.Canvas.prototype = {
3423534235 var CANVAS = this,
3423634236 rootBBox = this._RENDERER.getRootBBox(),
3423734237 rootGroup = this._RENDERER.getRootGroup(),
34238+ scale = this.getScale(),
34239+ canvasWidth = this.getCanvasSize()[0],
34240+ canvasHeight = this.getCanvasSize()[1],
3423834241 jsonObj = {
3423934242 opengraph: {
34240- '@width': rootBBox.width,
34241- '@height': rootBBox.height,
34243+ '@width': canvasWidth,
34244+ '@height': canvasHeight,
34245+ '@scale': scale,
3424234246 cell: []
3424334247 }
3424434248 },
3424534249 childShape, i, cellMap;
34246-
3424734250 cellMap = {};
3424834251
3424934252 childShape = function (node) {
@@ -34414,7 +34417,7 @@ OG.graph.Canvas.prototype = {
3441434417 */
3441534418 loadJSON: function (json) {
3441634419 this.fastLoadingON();
34417- var canvasWidth, canvasHeight, rootGroup,
34420+ var canvasWidth, canvasHeight, rootGroup, canvasScale,
3441834421 minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE,
3441934422 i, cell, shape, id, parent, shapeType, shapeId, x, y, width, height, style, geom, from, to,
3442034423 fromEdge, toEdge, label, fromLabel, toLabel, angle, value, data, dataExt, element, loopType, taskType, swimlane, textList;
@@ -34424,6 +34427,13 @@ OG.graph.Canvas.prototype = {
3442434427 if (json && json.opengraph && json.opengraph.cell && OG.Util.isArray(json.opengraph.cell)) {
3442534428 canvasWidth = json.opengraph['@width'];
3442634429 canvasHeight = json.opengraph['@height'];
34430+ canvasScale = json.opengraph['@scale'];
34431+ if (canvasScale) {
34432+ this.setScale(canvasScale);
34433+ } else {
34434+ this.setScale(1);
34435+ }
34436+ this.setCanvasSize([canvasWidth, canvasHeight]);
3442734437
3442834438 data = json.opengraph['@data'];
3442934439 dataExt = json.opengraph['@dataExt'];
@@ -34587,8 +34597,6 @@ OG.graph.Canvas.prototype = {
3458734597 }
3458834598 }
3458934599
34590- this.setCanvasSize([canvasWidth, canvasHeight]);
34591-
3459234600 this.fastLoadingOFF();
3459334601
3459434602 return {
0 commit comments