@syncfusion/ej2-image-editor 33.1.44 → 33.2.7

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.
@@ -15776,9 +15776,18 @@ var Shape = /** @__PURE__ @class */ (function () {
15776
15776
  if (parent.activeObj.rotatedAngle !== 0) {
15777
15777
  parent.notify('selection', { prop: 'updPtCollForShpRot', onPropertyChange: false, value: { obj: parent.activeObj } });
15778
15778
  }
15779
+ var isDuplicate = false;
15780
+ for (var i = 0; i < parent.objColl.length; i++) {
15781
+ if (parent.objColl[i].currIndex === parent.activeObj.currIndex) {
15782
+ isDuplicate = true;
15783
+ break;
15784
+ }
15785
+ }
15779
15786
  if (allowUndoRedo) {
15780
15787
  this.apply(parent.activeObj.shape, parent.activeObj);
15781
- parent.objColl.push(extend({}, parent.activeObj, {}, true));
15788
+ if (!isDuplicate) {
15789
+ parent.objColl.push(extend({}, parent.activeObj, {}, true));
15790
+ }
15782
15791
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
15783
15792
  value: { operation: 'text', previousObj: prevObj, previousObjColl: prevObj.objColl,
15784
15793
  previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
@@ -15787,7 +15796,9 @@ var Shape = /** @__PURE__ @class */ (function () {
15787
15796
  }
15788
15797
  else {
15789
15798
  this.apply(parent.activeObj.shape, parent.activeObj);
15790
- parent.objColl.push(extend({}, parent.activeObj, {}, true));
15799
+ if (!isDuplicate) {
15800
+ parent.objColl.push(extend({}, parent.activeObj, {}, true));
15801
+ }
15791
15802
  }
15792
15803
  };
15793
15804
  Shape.prototype.iterateObjColl = function () {
@@ -17788,6 +17799,18 @@ var Shape = /** @__PURE__ @class */ (function () {
17788
17799
  parent.activeObj.redactBlur = parent.tempRedactBlur;
17789
17800
  parent.activeObj.redactPixelate = parent.tempRedactPixel;
17790
17801
  };
17802
+ Shape.prototype.removeDuplicates = function (collection) {
17803
+ for (var i = 0; i < collection.length; i++) {
17804
+ var currentObj = collection[i];
17805
+ for (var j = 0; j < i; j++) {
17806
+ if (collection[j].currIndex === currentObj.currIndex) {
17807
+ collection.splice(i, 1);
17808
+ i--;
17809
+ break;
17810
+ }
17811
+ }
17812
+ }
17813
+ };
17791
17814
  Shape.prototype.applyActObj = function (isMouseDown) {
17792
17815
  var parent = this.parent;
17793
17816
  var isActObj = false;
@@ -17825,6 +17848,17 @@ var Shape = /** @__PURE__ @class */ (function () {
17825
17848
  var splitWords_1 = parent.activeObj.currIndex.split('_');
17826
17849
  var tempObjColl = parent.objColl.splice(0, parseInt(splitWords_1[1], 10) - 1);
17827
17850
  tempObjColl.push(extend({}, parent.activeObj, {}, true));
17851
+ this.removeDuplicates(parent.objColl);
17852
+ this.removeDuplicates(tempObjColl);
17853
+ for (var i = 0; i < parent.objColl.length; i++) {
17854
+ var currentObj = parent.objColl[i];
17855
+ for (var j = 0; j < tempObjColl.length; j++) {
17856
+ if (tempObjColl[j].currIndex === currentObj.currIndex) {
17857
+ tempObjColl.splice(j, 1);
17858
+ j--;
17859
+ }
17860
+ }
17861
+ }
17828
17862
  for (var i = 0; i < parent.objColl.length; i++) {
17829
17863
  tempObjColl.push(parent.objColl[i]);
17830
17864
  }
@@ -18845,7 +18879,9 @@ var Shape = /** @__PURE__ @class */ (function () {
18845
18879
  var order = 1;
18846
18880
  var isBreak;
18847
18881
  var isCrop = false;
18848
- while (tempObjColl.length !== 0 || tempPointColl.length !== 0) {
18882
+ var count = 0;
18883
+ while ((tempObjColl.length !== 0 || tempPointColl.length !== 0) && count < 100) {
18884
+ count++;
18849
18885
  isBreak = isCrop = false;
18850
18886
  for (var i = 0; i < tempObjColl.length; i++) {
18851
18887
  if (tempObjColl[i].order === order ||