@syncfusion/ej2-image-editor 30.2.5 → 31.1.21

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.
@@ -6379,8 +6379,12 @@ class Export {
6379
6379
  type = type ? type : 'Png';
6380
6380
  parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
6381
6381
  value: { x: null, y: null, isMouseDown: null } });
6382
+ const imageQualityObj = { currentImageQuality: 1 };
6383
+ if (type.toLowerCase() === 'jpeg') {
6384
+ parent.notify('toolbar', { prop: 'getcurrentImageQuality', onPropertyChange: false, value: { obj: imageQualityObj } });
6385
+ }
6382
6386
  const beforeSave = { cancel: false, fileName: fileName ? fileName : imageName,
6383
- fileType: type, imageQuality: imgQuality };
6387
+ fileType: type, imageQuality: imgQuality || imageQualityObj['currentImageQuality'] };
6384
6388
  parent.trigger('beforeSave', beforeSave);
6385
6389
  this.beforeSaveEvent(beforeSave, type, fileName, imageName, imgQuality);
6386
6390
  }
@@ -8882,6 +8886,11 @@ class FreehandDrawing {
8882
8886
  const parent = this.parent;
8883
8887
  const point = parent.pointColl[this.fhdSelIdx];
8884
8888
  parent.trigger('shapeChanging', shapeChangingArgs);
8889
+ if (shapeChangingArgs.cancel) {
8890
+ parent.editCompleteArgs = shapeChangingArgs;
8891
+ this.cancelFhd();
8892
+ return;
8893
+ }
8885
8894
  if (parent.element.getAttribute('data-value') === 'mask-drawing' && !this.isMasking) {
8886
8895
  this.isMasking = true;
8887
8896
  parent.upperCanvas.style.cursor = 'crosshair';
@@ -12403,6 +12412,9 @@ class Selection {
12403
12412
  const objColl = extend([], parent.objColl, [], true);
12404
12413
  if (!isNullOrUndefined(obj['index']) && obj['index'] > -1) {
12405
12414
  parent.notify('freehand-draw', { prop: 'selectFhd', value: { type: 'ok' } });
12415
+ if (!this.isFhdPoint) {
12416
+ return;
12417
+ }
12406
12418
  parent.notify('freehand-draw', { prop: 'hoverFhd', onPropertyChange: false,
12407
12419
  value: { strokeColor: null, strokeWidth: null } });
12408
12420
  parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
@@ -12947,7 +12959,9 @@ class Selection {
12947
12959
  this.currentDrawingShape = parent.drawingShape.toLowerCase();
12948
12960
  if (dummyClick) {
12949
12961
  parent.enableShapeDrawing(parent.toPascalCase(parent.drawingShape), true);
12950
- parent.upperCanvas.style.cursor = 'crosshair';
12962
+ if (parent.cursor !== 'move') {
12963
+ parent.upperCanvas.style.cursor = 'crosshair';
12964
+ }
12951
12965
  }
12952
12966
  }
12953
12967
  parent.isShapeDrawing = false;
@@ -13969,7 +13983,14 @@ class Selection {
13969
13983
  }
13970
13984
  if (!this.isCropSelection && parent.activeObj.shape !== 'redact') {
13971
13985
  parent.trigger('shapeChanging', shapeChangingArgs);
13972
- this.shapeEvent(shapeChangingArgs);
13986
+ if (shapeChangingArgs.cancel) {
13987
+ parent.objColl.splice(i, 0, temp);
13988
+ parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
13989
+ parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null } });
13990
+ }
13991
+ else {
13992
+ this.shapeEvent(shapeChangingArgs);
13993
+ }
13973
13994
  parent.editCompleteArgs = shapeChangingArgs;
13974
13995
  }
13975
13996
  else {
@@ -21207,15 +21228,15 @@ class UndoRedo {
21207
21228
  this.updateUndoRedoStack();
21208
21229
  }
21209
21230
  break;
21210
- case 'reset':
21211
- this.reset();
21212
- break;
21213
21231
  case 'preventEditComplete':
21214
21232
  args.value['obj']['bool'] = this.preventEditComplete;
21215
21233
  break;
21216
21234
  case 'preventApplyEditComplete':
21217
21235
  this.preventApplyEditComplete = args.value['bool'];
21218
21236
  break;
21237
+ case 'reset':
21238
+ this.reset();
21239
+ break;
21219
21240
  }
21220
21241
  }
21221
21242
  getModuleName() {
@@ -27849,6 +27870,9 @@ class ToolbarModule {
27849
27870
  case 'getToolbarHeight':
27850
27871
  args.value['obj']['toolbarHeight'] = this.toolbarHeight;
27851
27872
  break;
27873
+ case 'getcurrentImageQuality':
27874
+ args.value['obj']['currentImageQuality'] = this.currentQuality;
27875
+ break;
27852
27876
  case 'setToolbarHeight':
27853
27877
  if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0 && parent.toolbar.indexOf('Open') > -1)) {
27854
27878
  this.toolbarHeight = args.value['height'];