@syncfusion/ej2-image-editor 30.1.38 → 30.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.
@@ -6396,7 +6396,7 @@ class Export {
6396
6396
  this.toSVGImg(fileName);
6397
6397
  }
6398
6398
  else {
6399
- this.toBlobFn(fileName, lowerCaseType, imgQuality);
6399
+ this.toBlobFn(fileName, lowerCaseType, observableSaveArgs.imageQuality || imgQuality);
6400
6400
  }
6401
6401
  const saved = { fileName: fileName ? fileName : imageName, fileType: type };
6402
6402
  parent.trigger('saved', saved);
@@ -7867,6 +7867,15 @@ class FreehandDrawing {
7867
7867
  case 'resetFreehandDrawSelectedId':
7868
7868
  this.fhdSelID = null;
7869
7869
  break;
7870
+ case 'getFHDSelected':
7871
+ args.value['obj']['isSelected'] = (this.parent.pointColl[this.fhdSelIdx] && this.parent.pointColl[this.fhdSelIdx].isSelected) ? this.parent.pointColl[this.fhdSelIdx].isSelected : false;
7872
+ break;
7873
+ case 'resetFHDIdx':
7874
+ this.fhdHovIdx = this.fhdSelID = this.fhdSelIdx = null;
7875
+ break;
7876
+ case 'getHighestOrder':
7877
+ this.getHighestOrder();
7878
+ break;
7870
7879
  case 'getTempFreeHandDrawEditingStyles':
7871
7880
  args.value['obj']['tempFreeHandDrawEditingStyles'] = this.tempFHDStyles;
7872
7881
  break;
@@ -8049,10 +8058,11 @@ class FreehandDrawing {
8049
8058
  parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false, value: { obj: selPointCollObj } });
8050
8059
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
8051
8060
  const fhCnt = parent.freehandCounter;
8052
- const order = parent.objColl.length + parent.freehandCounter + 1;
8061
+ const penIndex = this.getHighestOrder();
8062
+ const order = parent.objColl.length + penIndex + 1;
8053
8063
  parent.pointColl[fhCnt] = { points: extend([], parent.points), strokeColor: parent.activeObj.strokeSettings.strokeColor,
8054
8064
  strokeWidth: this.penStrokeWidth, flipState: parent.transform.currFlipState,
8055
- id: 'pen_' + (this.currFHDIdx + 1), order: order };
8065
+ id: 'pen_' + (penIndex + 1), order: order };
8056
8066
  parent.points = [];
8057
8067
  this.dummyPoints = [];
8058
8068
  this.selPointColl[fhCnt] = { points: extend([], this.selPoints) };
@@ -8067,7 +8077,7 @@ class FreehandDrawing {
8067
8077
  previousCropObj: prevCropObj, previousText: null,
8068
8078
  currentText: null, previousFilter: null, isCircleCrop: null } });
8069
8079
  }
8070
- const shapeSettings = { id: 'pen_' + (this.currFHDIdx + 1), type: ShapeType.FreehandDraw,
8080
+ const shapeSettings = { id: 'pen_' + (penIndex + 1), type: ShapeType.FreehandDraw,
8071
8081
  startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
8072
8082
  strokeColor: parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.penStrokeWidth,
8073
8083
  points: parent.pointColl[this.currFHDIdx].points, index: order };
@@ -8076,6 +8086,17 @@ class FreehandDrawing {
8076
8086
  this.triggerShapeChanging(shapeChangingArgs);
8077
8087
  this.currFHDIdx++;
8078
8088
  }
8089
+ getHighestOrder() {
8090
+ const parent = this.parent;
8091
+ let index = 0;
8092
+ for (let i = 0; i < parent.pointColl.length; i++) {
8093
+ const value = parseInt(parent.pointColl[i].id.split('_')[1], 10);
8094
+ if (index < value) {
8095
+ index = value;
8096
+ }
8097
+ }
8098
+ return index;
8099
+ }
8079
8100
  freehandMoveHandler(e) {
8080
8101
  this.isFreehandPointMoved = true;
8081
8102
  const rect = this.parent.upperCanvas.getBoundingClientRect();
@@ -8464,6 +8485,7 @@ class FreehandDrawing {
8464
8485
  }
8465
8486
  parent.freehandCounter -= 1;
8466
8487
  this.fhdHovIdx = this.fhdSelIdx = null;
8488
+ this.currFHDIdx--;
8467
8489
  parent.notify('selection', { prop: 'resetFreehandDrawVariables' });
8468
8490
  parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null } });
8469
8491
  parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
@@ -21457,6 +21479,12 @@ class UndoRedo {
21457
21479
  parent.initialAdjustmentValue = this.lowerContext.filter;
21458
21480
  parent.notify('filter', { prop: 'setBevelFilter', onPropertyChange: false, value: { bevelFilter: this.lowerContext.filter } });
21459
21481
  const editCompleteArgs = { action: this.getUndoRedoAction(obj.operation) };
21482
+ let isSelected;
21483
+ if (obj.operation === 'freehanddraw' || obj.operation === 'freehand-draw') {
21484
+ const object = { isSelected: null };
21485
+ parent.notify('freehand-draw', { prop: 'getFHDSelected', onPropertyChange: false, value: { obj: object } });
21486
+ isSelected = object['isSelected'];
21487
+ }
21460
21488
  switch (obj.operation) {
21461
21489
  case 'shapeTransform':
21462
21490
  case 'brightness':
@@ -21484,6 +21512,10 @@ class UndoRedo {
21484
21512
  this.updateFreehandDraw(obj.previousPointColl, obj.previousSelPointColl);
21485
21513
  parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
21486
21514
  value: { value: parent.pointColl.length } });
21515
+ if (isSelected) {
21516
+ parent.notify('freehand-draw', { prop: 'resetFHDIdx' });
21517
+ parent.notify('selection', { prop: 'resetFreehandDrawVariables' });
21518
+ }
21487
21519
  break;
21488
21520
  case 'freehanddrawCustomized':
21489
21521
  this.updateFreehandDrawCustomized(obj.previousObjColl, obj.previousPointColl);