devexpress-diagram 2.1.45 → 2.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Diagram (dx-diagram)
3
- * Version: 2.1.45
4
- * Build date: Thu Jan 13 2022
3
+ * Version: 2.1.46
4
+ * Build date: Tue Jan 18 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Diagram (dx-diagram)
3
- * Version: 2.1.45
4
- * Build date: Thu Jan 13 2022
3
+ * Version: 2.1.46
4
+ * Build date: Tue Jan 18 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -6088,6 +6088,7 @@ var DiagramSettings = /** @class */ (function () {
6088
6088
  this._viewUnits = Enums_1.DiagramUnit.In;
6089
6089
  this._connectorRoutingMode = ConnectorRoutingMode.AllShapesOnly;
6090
6090
  this._reloadInsertedItemRequired = false;
6091
+ this._useCanvgForExportToImage = true;
6091
6092
  }
6092
6093
  Object.defineProperty(DiagramSettings.prototype, "zoomLevel", {
6093
6094
  get: function () { return this._zoomLevel; },
@@ -6239,6 +6240,14 @@ var DiagramSettings = /** @class */ (function () {
6239
6240
  enumerable: false,
6240
6241
  configurable: true
6241
6242
  });
6243
+ Object.defineProperty(DiagramSettings.prototype, "useCanvgForExportToImage", {
6244
+ get: function () { return this._useCanvgForExportToImage; },
6245
+ set: function (value) {
6246
+ this._useCanvgForExportToImage = value;
6247
+ },
6248
+ enumerable: false,
6249
+ configurable: true
6250
+ });
6242
6251
  Object.defineProperty(DiagramSettings.prototype, "shapeMinWidth", {
6243
6252
  get: function () { return this._shapeMinWidth; },
6244
6253
  set: function (value) { this._shapeMinWidth = value; },
@@ -10232,11 +10241,11 @@ var Exporter = /** @class */ (function () {
10232
10241
  Exporter.prototype.exportSvg = function (modelSize, pageColor, exportManager, callback) {
10233
10242
  exportManager.exportSvgImage(modelSize, pageColor, callback);
10234
10243
  };
10235
- Exporter.prototype.exportPng = function (modelSize, pageColor, exportManager, callback) {
10236
- exportManager.exportPngImage(modelSize, pageColor, callback);
10244
+ Exporter.prototype.exportPng = function (modelSize, pageColor, exportManager, callback, useCanvgForExportToImage) {
10245
+ exportManager.exportPngImage(modelSize, pageColor, callback, useCanvgForExportToImage);
10237
10246
  };
10238
- Exporter.prototype.exportJpg = function (modelSize, pageColor, exportManager, callback) {
10239
- exportManager.exportJpgImage(modelSize, pageColor, callback);
10247
+ Exporter.prototype.exportJpg = function (modelSize, pageColor, exportManager, callback, useCanvgForExportToImage) {
10248
+ exportManager.exportJpgImage(modelSize, pageColor, callback, useCanvgForExportToImage);
10240
10249
  };
10241
10250
  return Exporter;
10242
10251
  }());
@@ -13269,7 +13278,7 @@ var ExportImageCommand = /** @class */ (function (_super) {
13269
13278
  exportFunc(this.control.model.size.clone(), this.control.model.pageColor, exportManager, function (url) {
13270
13279
  parameter(url, _this.getExtension());
13271
13280
  _this.tryDispose();
13272
- });
13281
+ }, this.control.settings.useCanvgForExportToImage);
13273
13282
  }
13274
13283
  catch (e) {
13275
13284
  this.tryDispose();
@@ -26650,7 +26659,7 @@ var CanvasExportManager = /** @class */ (function (_super) {
26650
26659
  CanvasExportManager.prototype.exportSvgImage = function (modelSize, pageColor, callback) {
26651
26660
  callback(this.getSvgImageUrl(modelSize, pageColor, true));
26652
26661
  };
26653
- CanvasExportManager.prototype.exportBinaryImage = function (modelSize, pageColor, mimeType, callback) {
26662
+ CanvasExportManager.prototype.exportBinaryImage = function (modelSize, pageColor, mimeType, callback, useCanvgForExportToImage) {
26654
26663
  var modelAbsSize = this.getAbsoluteSize(modelSize).clone().applyConverter(Math.ceil);
26655
26664
  var canvasEl = document.createElement("canvas");
26656
26665
  canvasEl.width = modelAbsSize.width;
@@ -26658,7 +26667,7 @@ var CanvasExportManager = /** @class */ (function (_super) {
26658
26667
  var ctx = canvasEl.getContext("2d");
26659
26668
  ctx.fillStyle = color_1.ColorUtils.colorToHash(pageColor);
26660
26669
  ctx.fillRect(0, 0, modelAbsSize.width, modelAbsSize.height);
26661
- if (browser_1.Browser.IE && typeof canvg === "object")
26670
+ if ((useCanvgForExportToImage || browser_1.Browser.IE) && typeof canvg === "object")
26662
26671
  this.exportBinaryImageCanvgAsync(modelSize, pageColor, canvasEl, ctx, mimeType).then(function (dataUrl) { return callback(dataUrl); });
26663
26672
  else if (browser_1.Browser.IE && typeof canvg === "function")
26664
26673
  this.exportBinaryImageCanvgOld(modelSize, pageColor, canvasEl, ctx, mimeType, callback);
@@ -26700,11 +26709,11 @@ var CanvasExportManager = /** @class */ (function (_super) {
26700
26709
  });
26701
26710
  });
26702
26711
  };
26703
- CanvasExportManager.prototype.exportPngImage = function (modelSize, pageColor, callback) {
26704
- this.exportBinaryImage(modelSize, pageColor, "image/png", callback);
26712
+ CanvasExportManager.prototype.exportPngImage = function (modelSize, pageColor, callback, useCanvgForExportToImage) {
26713
+ this.exportBinaryImage(modelSize, pageColor, "image/png", callback, useCanvgForExportToImage);
26705
26714
  };
26706
- CanvasExportManager.prototype.exportJpgImage = function (modelSize, pageColor, callback) {
26707
- this.exportBinaryImage(modelSize, pageColor, "image/jpeg", callback);
26715
+ CanvasExportManager.prototype.exportJpgImage = function (modelSize, pageColor, callback, useCanvgForExportToImage) {
26716
+ this.exportBinaryImage(modelSize, pageColor, "image/jpeg", callback, useCanvgForExportToImage);
26708
26717
  };
26709
26718
  CanvasExportManager.prototype.notifyModelChanged = function (changes) { };
26710
26719
  CanvasExportManager.prototype.notifyPageColorChanged = function (color) { };
@@ -29724,6 +29733,7 @@ var DiagramControl = /** @class */ (function () {
29724
29733
  this.shapeDescriptionManager.unregisterAllCustomShapes();
29725
29734
  };
29726
29735
  DiagramControl.prototype.importModel = function (model) {
29736
+ model.units = this.model.units; // don't rewrite units
29727
29737
  this.model = model;
29728
29738
  this.model.initializeKeyCounter();
29729
29739
  this.apiController.model = model;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Diagram (dx-diagram.min)
3
- * Version: 2.1.45
4
- * Build date: Thu Jan 13 2022
3
+ * Version: 2.1.46
4
+ * Build date: Tue Jan 18 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs