@syncfusion/ej2-image-editor 21.1.41 → 21.2.5

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.
@@ -447,6 +447,12 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
447
447
  if (isNullOrUndefined(this.zoomSettings.zoomTrigger)) {
448
448
  this.zoomSettings.zoomTrigger = (ZoomTrigger.MouseWheel | ZoomTrigger.Pinch | ZoomTrigger.Toolbar | ZoomTrigger.Commands);
449
449
  }
450
+ if (isNullOrUndefined(this.zoomSettings.zoomFactor)) {
451
+ this.zoomSettings.zoomFactor = 1;
452
+ }
453
+ if (isNullOrUndefined(this.zoomSettings.maxZoomFactor)) {
454
+ this.zoomSettings.maxZoomFactor = 10;
455
+ }
450
456
  }
451
457
  getDefaultFilter() {
452
458
  return 'brightness(' + 1 + ') ' + 'contrast(' + 100 + '%) ' + 'hue-rotate(' + 0 + 'deg) ' +
@@ -6702,7 +6708,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
6702
6708
  const x = points.x;
6703
6709
  const y = points.y;
6704
6710
  isShape = this.findTargetObj(x, y, isCropSelection);
6705
- this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
6711
+ if (!isCropSelection) {
6712
+ this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
6713
+ }
6706
6714
  if (isTextArea) {
6707
6715
  this.textArea.value = this.objColl[this.objColl.length - 1].keyHistory;
6708
6716
  this.textArea.style.display = 'block';
@@ -6742,7 +6750,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
6742
6750
  const x = points.x;
6743
6751
  const y = points.y;
6744
6752
  isShape = this.findTargetObj(x, y, isCropSelection);
6745
- this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
6753
+ if (!isCropSelection) {
6754
+ this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
6755
+ }
6746
6756
  if (isTextArea) {
6747
6757
  this.textArea.value = this.objColl[this.objColl.length - 1].keyHistory;
6748
6758
  this.textArea.style.display = 'block';
@@ -13223,28 +13233,8 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
13223
13233
  * @returns {ImageData}.
13224
13234
  */
13225
13235
  getImageData() {
13226
- if (!isNullOrUndefined(this.activeObj.shape)) {
13227
- this.performCancel();
13228
- }
13229
- let currentObj;
13230
- if (this.defaultZoomFactor > 0) {
13231
- currentObj = this.getCurrentObj();
13232
- currentObj.objColl = extend([], this.objColl, [], true);
13233
- currentObj.pointColl = extend([], this.pointColl, [], true);
13234
- currentObj.afterCropActions = extend([], this.afterCropActions, [], true);
13235
- }
13236
- this.resetZoom();
13237
- const data = this.lowerContext.getImageData(this.destLeft, this.destTop, this.destWidth, this.destHeight);
13238
- if (!isNullOrUndefined(currentObj)) {
13239
- this.setCurrentObj(currentObj);
13240
- this.objColl = extend([], currentObj.objColl, [], true);
13241
- this.pointColl = extend([], currentObj.pointColl, [], true);
13242
- this.freehandCounter = this.pointColl.length;
13243
- this.lowerContext.filter = 'none';
13244
- this.zoomObjColl();
13245
- this.zoomFreehandDrawColl();
13246
- this.lowerContext.filter = currentObj.filter;
13247
- }
13236
+ const canvas = this.exportChangesToCanvas();
13237
+ const data = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height);
13248
13238
  return data;
13249
13239
  }
13250
13240
  /**
@@ -14614,7 +14604,7 @@ var ShapeType;
14614
14604
  /**
14615
14605
  * An enumeration representing the different ways to trigger zooming in the image editor.
14616
14606
  *
14617
- * @enum {number}
14607
+ * @aspNumberEnum
14618
14608
  */
14619
14609
  var ZoomTrigger;
14620
14610
  (function (ZoomTrigger) {