@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.
@@ -6454,7 +6454,7 @@ var Export = /** @__PURE__ @class */ (function () {
6454
6454
  this.toSVGImg(fileName);
6455
6455
  }
6456
6456
  else {
6457
- this.toBlobFn(fileName, lowerCaseType, imgQuality);
6457
+ this.toBlobFn(fileName, lowerCaseType, observableSaveArgs.imageQuality || imgQuality);
6458
6458
  }
6459
6459
  var saved = { fileName: fileName ? fileName : imageName, fileType: type };
6460
6460
  parent.trigger('saved', saved);
@@ -7937,6 +7937,15 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
7937
7937
  case 'resetFreehandDrawSelectedId':
7938
7938
  this.fhdSelID = null;
7939
7939
  break;
7940
+ case 'getFHDSelected':
7941
+ args.value['obj']['isSelected'] = (this.parent.pointColl[this.fhdSelIdx] && this.parent.pointColl[this.fhdSelIdx].isSelected) ? this.parent.pointColl[this.fhdSelIdx].isSelected : false;
7942
+ break;
7943
+ case 'resetFHDIdx':
7944
+ this.fhdHovIdx = this.fhdSelID = this.fhdSelIdx = null;
7945
+ break;
7946
+ case 'getHighestOrder':
7947
+ this.getHighestOrder();
7948
+ break;
7940
7949
  case 'getTempFreeHandDrawEditingStyles':
7941
7950
  args.value['obj']['tempFreeHandDrawEditingStyles'] = this.tempFHDStyles;
7942
7951
  break;
@@ -8119,10 +8128,11 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
8119
8128
  parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false, value: { obj: selPointCollObj } });
8120
8129
  prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
8121
8130
  var fhCnt = parent.freehandCounter;
8122
- var order = parent.objColl.length + parent.freehandCounter + 1;
8131
+ var penIndex = this.getHighestOrder();
8132
+ var order = parent.objColl.length + penIndex + 1;
8123
8133
  parent.pointColl[fhCnt] = { points: extend([], parent.points), strokeColor: parent.activeObj.strokeSettings.strokeColor,
8124
8134
  strokeWidth: this.penStrokeWidth, flipState: parent.transform.currFlipState,
8125
- id: 'pen_' + (this.currFHDIdx + 1), order: order };
8135
+ id: 'pen_' + (penIndex + 1), order: order };
8126
8136
  parent.points = [];
8127
8137
  this.dummyPoints = [];
8128
8138
  this.selPointColl[fhCnt] = { points: extend([], this.selPoints) };
@@ -8137,7 +8147,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
8137
8147
  previousCropObj: prevCropObj, previousText: null,
8138
8148
  currentText: null, previousFilter: null, isCircleCrop: null } });
8139
8149
  }
8140
- var shapeSettings = { id: 'pen_' + (this.currFHDIdx + 1), type: ShapeType.FreehandDraw,
8150
+ var shapeSettings = { id: 'pen_' + (penIndex + 1), type: ShapeType.FreehandDraw,
8141
8151
  startX: this.freehandDownPoint.x, startY: this.freehandDownPoint.y,
8142
8152
  strokeColor: parent.activeObj.strokeSettings.strokeColor, strokeWidth: this.penStrokeWidth,
8143
8153
  points: parent.pointColl[this.currFHDIdx].points, index: order };
@@ -8146,6 +8156,17 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
8146
8156
  this.triggerShapeChanging(shapeChangingArgs);
8147
8157
  this.currFHDIdx++;
8148
8158
  };
8159
+ FreehandDrawing.prototype.getHighestOrder = function () {
8160
+ var parent = this.parent;
8161
+ var index = 0;
8162
+ for (var i = 0; i < parent.pointColl.length; i++) {
8163
+ var value = parseInt(parent.pointColl[i].id.split('_')[1], 10);
8164
+ if (index < value) {
8165
+ index = value;
8166
+ }
8167
+ }
8168
+ return index;
8169
+ };
8149
8170
  FreehandDrawing.prototype.freehandMoveHandler = function (e) {
8150
8171
  this.isFreehandPointMoved = true;
8151
8172
  var rect = this.parent.upperCanvas.getBoundingClientRect();
@@ -8534,6 +8555,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
8534
8555
  }
8535
8556
  parent.freehandCounter -= 1;
8536
8557
  this.fhdHovIdx = this.fhdSelIdx = null;
8558
+ this.currFHDIdx--;
8537
8559
  parent.notify('selection', { prop: 'resetFreehandDrawVariables' });
8538
8560
  parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null } });
8539
8561
  parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
@@ -21536,6 +21558,12 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
21536
21558
  parent.initialAdjustmentValue = this.lowerContext.filter;
21537
21559
  parent.notify('filter', { prop: 'setBevelFilter', onPropertyChange: false, value: { bevelFilter: this.lowerContext.filter } });
21538
21560
  var editCompleteArgs = { action: this.getUndoRedoAction(obj.operation) };
21561
+ var isSelected = void 0;
21562
+ if (obj.operation === 'freehanddraw' || obj.operation === 'freehand-draw') {
21563
+ var object = { isSelected: null };
21564
+ parent.notify('freehand-draw', { prop: 'getFHDSelected', onPropertyChange: false, value: { obj: object } });
21565
+ isSelected = object['isSelected'];
21566
+ }
21539
21567
  switch (obj.operation) {
21540
21568
  case 'shapeTransform':
21541
21569
  case 'brightness':
@@ -21563,6 +21591,10 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
21563
21591
  this.updateFreehandDraw(obj.previousPointColl, obj.previousSelPointColl);
21564
21592
  parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
21565
21593
  value: { value: parent.pointColl.length } });
21594
+ if (isSelected) {
21595
+ parent.notify('freehand-draw', { prop: 'resetFHDIdx' });
21596
+ parent.notify('selection', { prop: 'resetFreehandDrawVariables' });
21597
+ }
21566
21598
  break;
21567
21599
  case 'freehanddrawCustomized':
21568
21600
  this.updateFreehandDrawCustomized(obj.previousObjColl, obj.previousPointColl);