@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.
@@ -15702,9 +15702,18 @@ class Shape {
15702
15702
  if (parent.activeObj.rotatedAngle !== 0) {
15703
15703
  parent.notify('selection', { prop: 'updPtCollForShpRot', onPropertyChange: false, value: { obj: parent.activeObj } });
15704
15704
  }
15705
+ let isDuplicate = false;
15706
+ for (let i = 0; i < parent.objColl.length; i++) {
15707
+ if (parent.objColl[i].currIndex === parent.activeObj.currIndex) {
15708
+ isDuplicate = true;
15709
+ break;
15710
+ }
15711
+ }
15705
15712
  if (allowUndoRedo) {
15706
15713
  this.apply(parent.activeObj.shape, parent.activeObj);
15707
- parent.objColl.push(extend({}, parent.activeObj, {}, true));
15714
+ if (!isDuplicate) {
15715
+ parent.objColl.push(extend({}, parent.activeObj, {}, true));
15716
+ }
15708
15717
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
15709
15718
  value: { operation: 'text', previousObj: prevObj, previousObjColl: prevObj.objColl,
15710
15719
  previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
@@ -15713,7 +15722,9 @@ class Shape {
15713
15722
  }
15714
15723
  else {
15715
15724
  this.apply(parent.activeObj.shape, parent.activeObj);
15716
- parent.objColl.push(extend({}, parent.activeObj, {}, true));
15725
+ if (!isDuplicate) {
15726
+ parent.objColl.push(extend({}, parent.activeObj, {}, true));
15727
+ }
15717
15728
  }
15718
15729
  }
15719
15730
  iterateObjColl() {
@@ -17712,6 +17723,18 @@ class Shape {
17712
17723
  parent.activeObj.redactBlur = parent.tempRedactBlur;
17713
17724
  parent.activeObj.redactPixelate = parent.tempRedactPixel;
17714
17725
  }
17726
+ removeDuplicates(collection) {
17727
+ for (let i = 0; i < collection.length; i++) {
17728
+ const currentObj = collection[i];
17729
+ for (let j = 0; j < i; j++) {
17730
+ if (collection[j].currIndex === currentObj.currIndex) {
17731
+ collection.splice(i, 1);
17732
+ i--;
17733
+ break;
17734
+ }
17735
+ }
17736
+ }
17737
+ }
17715
17738
  applyActObj(isMouseDown) {
17716
17739
  const parent = this.parent;
17717
17740
  let isActObj = false;
@@ -17749,6 +17772,17 @@ class Shape {
17749
17772
  const splitWords = parent.activeObj.currIndex.split('_');
17750
17773
  let tempObjColl = parent.objColl.splice(0, parseInt(splitWords[1], 10) - 1);
17751
17774
  tempObjColl.push(extend({}, parent.activeObj, {}, true));
17775
+ this.removeDuplicates(parent.objColl);
17776
+ this.removeDuplicates(tempObjColl);
17777
+ for (let i = 0; i < parent.objColl.length; i++) {
17778
+ const currentObj = parent.objColl[i];
17779
+ for (let j = 0; j < tempObjColl.length; j++) {
17780
+ if (tempObjColl[j].currIndex === currentObj.currIndex) {
17781
+ tempObjColl.splice(j, 1);
17782
+ j--;
17783
+ }
17784
+ }
17785
+ }
17752
17786
  for (let i = 0; i < parent.objColl.length; i++) {
17753
17787
  tempObjColl.push(parent.objColl[i]);
17754
17788
  }
@@ -18769,7 +18803,9 @@ class Shape {
18769
18803
  let order = 1;
18770
18804
  let isBreak;
18771
18805
  let isCrop = false;
18772
- while (tempObjColl.length !== 0 || tempPointColl.length !== 0) {
18806
+ let count = 0;
18807
+ while ((tempObjColl.length !== 0 || tempPointColl.length !== 0) && count < 100) {
18808
+ count++;
18773
18809
  isBreak = isCrop = false;
18774
18810
  for (let i = 0; i < tempObjColl.length; i++) {
18775
18811
  if (tempObjColl[i].order === order ||