@syncfusion/ej2-image-editor 22.1.38 → 22.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.
@@ -11,6 +11,7 @@ var FreehandDrawing = /** @class */ (function () {
11
11
  this.selPointColl = {};
12
12
  this.currFHDIdx = 0; // Specifies id for every freehand drawing - uses while deleting
13
13
  this.selPoints = [];
14
+ this.dummyPoints = [];
14
15
  this.tempFHDStyles = { strokeColor: null, fillColor: null, strokeWidth: null };
15
16
  this.parent = parent;
16
17
  this.addEventListener();
@@ -164,6 +165,7 @@ var FreehandDrawing = /** @class */ (function () {
164
165
  this.fhdObj = { lastWidth: 0, lastVelocity: 0, time: 0, pointX: 0, pointY: 0 };
165
166
  this.isFreehandDrawing = this.isFreehandPointMoved = false;
166
167
  this.selPoints = [];
168
+ this.dummyPoints = [];
167
169
  this.freehandDownPoint = { x: 0, y: 0 };
168
170
  this.selPointColl = {};
169
171
  this.fhdHovIdx = null;
@@ -212,7 +214,12 @@ var FreehandDrawing = /** @class */ (function () {
212
214
  if (parent.points[l + 1] && parent.points[l + 2] && parent.points[l + 2]) {
213
215
  controlPoint1 = (this.calcCurveCP(parent.points[l + 0], parent.points[l + 1], parent.points[l + 2])).controlPoint2;
214
216
  controlPoint2 = (this.calcCurveCP(parent.points[l + 1], parent.points[l + 2], parent.points[l + 3])).controlPoint1;
215
- startPoint = parent.points[l + 1];
217
+ if (l === 0) {
218
+ startPoint = parent.points[l];
219
+ }
220
+ else {
221
+ startPoint = parent.points[l + 1];
222
+ }
216
223
  endPoint = parent.points[l + 2];
217
224
  this.startDraw(context, controlPoint1, controlPoint2, startPoint, endPoint, minStrokeWidth, maxStrokeWidth);
218
225
  }
@@ -279,6 +286,7 @@ var FreehandDrawing = /** @class */ (function () {
279
286
  parent.pointColl[fhCnt].flipState = parent.transform.currFlipState;
280
287
  parent.pointColl[fhCnt].id = 'pen_' + (this.currFHDIdx + 1);
281
288
  parent.points = [];
289
+ this.dummyPoints = [];
282
290
  this.selPointColl[fhCnt] = {};
283
291
  this.selPointColl[fhCnt].points = extend([], this.selPoints);
284
292
  this.selPoints = [];
@@ -326,15 +334,21 @@ var FreehandDrawing = /** @class */ (function () {
326
334
  parent.points.push({ x: x, y: y, ratioX: (x - parent.img.destLeft) / parent.img.destWidth,
327
335
  ratioY: (y - parent.img.destTop) / parent.img.destHeight,
328
336
  time: this.fhdObj.time });
329
- if (parent.points.length > 3) {
330
- var p0 = parent.points[this.pointCounter];
331
- var p1 = parent.points[this.pointCounter + 1];
332
- var p2 = parent.points[this.pointCounter + 2];
333
- var p3 = parent.points[this.pointCounter + 3];
337
+ this.dummyPoints.push({ x: x, y: y, ratioX: (x - parent.img.destLeft) / parent.img.destWidth,
338
+ ratioY: (y - parent.img.destTop) / parent.img.destHeight,
339
+ time: this.fhdObj.time });
340
+ if (this.dummyPoints.length > 2) {
341
+ if (this.dummyPoints.length === 3) {
342
+ this.dummyPoints.unshift(this.dummyPoints[0]);
343
+ }
344
+ var p0 = this.dummyPoints[0];
345
+ var p1 = this.dummyPoints[1];
346
+ var p2 = this.dummyPoints[2];
347
+ var p3 = this.dummyPoints[3];
334
348
  controlPoint1 = this.calcCurveCP(p0, p1, p2).controlPoint2;
335
349
  controlPoint2 = this.calcCurveCP(p1, p2, p3).controlPoint1;
336
- startPoint = parent.points[this.pointCounter + 1];
337
- endPoint = parent.points[this.pointCounter + 2];
350
+ startPoint = this.dummyPoints[1];
351
+ endPoint = this.dummyPoints[2];
338
352
  var minStrokeWidth = 0.5;
339
353
  var maxStrokeWidth = 5;
340
354
  if (!isNullOrUndefined(this.penStrokeWidth)) {
@@ -342,6 +356,7 @@ var FreehandDrawing = /** @class */ (function () {
342
356
  }
343
357
  this.startDraw(context, controlPoint1, controlPoint2, startPoint, endPoint, minStrokeWidth, maxStrokeWidth);
344
358
  this.pointCounter++;
359
+ this.dummyPoints.shift();
345
360
  }
346
361
  if (mouseDown) {
347
362
  controlPoint1 = controlPoint2 = startPoint = endPoint = { x: x, y: y, time: new Date().getTime() };
@@ -512,7 +527,12 @@ var FreehandDrawing = /** @class */ (function () {
512
527
  if (parent.points[l + 1] && parent.points[l + 2] && parent.points[l + 2]) {
513
528
  controlPoint1 = (this.calcCurveCP(parent.points[l + 0], parent.points[l + 1], parent.points[l + 2])).controlPoint2;
514
529
  controlPoint2 = (this.calcCurveCP(parent.points[l + 1], parent.points[l + 2], parent.points[l + 3])).controlPoint1;
515
- startPoint = parent.points[l + 1];
530
+ if (l === 0) {
531
+ startPoint = parent.points[l];
532
+ }
533
+ else {
534
+ startPoint = parent.points[l + 1];
535
+ }
516
536
  endPoint = parent.points[l + 2];
517
537
  this.startDraw(context, controlPoint1, controlPoint2, startPoint, endPoint, minStrokeWidth, maxStrokeWidth);
518
538
  }
@@ -639,18 +659,21 @@ var FreehandDrawing = /** @class */ (function () {
639
659
  if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
640
660
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
641
661
  parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs).then(function (shapeChangingArgs) {
642
- parent.pointColl[_this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
643
- parent.pointColl[_this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
662
+ parent.activeObj.strokeSettings.strokeColor = parent.pointColl[_this.fhdSelIdx].strokeColor =
663
+ shapeChangingArgs.currentShapeSettings.strokeColor;
664
+ parent.activeObj.strokeSettings.strokeWidth = parent.pointColl[_this.fhdSelIdx].strokeWidth =
665
+ shapeChangingArgs.currentShapeSettings.strokeWidth;
644
666
  parent.pointColl[_this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
645
667
  _this.freehandRedraw(_this.upperContext);
646
- parent.updateToolbar(parent.element, 'imageLoaded');
647
- parent.updateToolbar(parent.element, 'pen');
668
+ parent.updateToolbar(parent.element, 'colorToolbar');
648
669
  });
649
670
  }
650
671
  else {
651
672
  parent.trigger('shapeChanging', shapeChangingArgs);
652
- parent.pointColl[this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
653
- parent.pointColl[this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
673
+ parent.activeObj.strokeSettings.strokeColor = parent.pointColl[this.fhdSelIdx].strokeColor =
674
+ shapeChangingArgs.currentShapeSettings.strokeColor;
675
+ parent.activeObj.strokeSettings.strokeWidth = parent.pointColl[this.fhdSelIdx].strokeWidth =
676
+ shapeChangingArgs.currentShapeSettings.strokeWidth;
654
677
  parent.pointColl[this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
655
678
  this.freehandRedraw(this.upperContext);
656
679
  parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
@@ -969,6 +992,7 @@ var FreehandDrawing = /** @class */ (function () {
969
992
  var parent = this.parent;
970
993
  if (value) {
971
994
  parent.points = [];
995
+ this.dummyPoints = [];
972
996
  parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
973
997
  parent.togglePen = true;
974
998
  parent.upperCanvas.style.cursor = parent.cursor = 'crosshair';
@@ -858,12 +858,8 @@ var Selection = /** @class */ (function () {
858
858
  var previousShapeSettings = this.updatePrevShapeSettings();
859
859
  var shapeResizingArgs = { action: 'resize', previousShapeSettings: previousShapeSettings };
860
860
  var shapeMovingArgs = { action: 'move', previousShapeSettings: previousShapeSettings };
861
- if (isNullOrUndefined(this.shapeResizingArgs)) {
862
- this.shapeResizingArgs = shapeResizingArgs;
863
- }
864
- if (isNullOrUndefined(this.shapeMovingArgs)) {
865
- this.shapeMovingArgs = shapeMovingArgs;
866
- }
861
+ this.shapeResizingArgs = shapeResizingArgs;
862
+ this.shapeMovingArgs = shapeMovingArgs;
867
863
  if (parent.activeObj.shape === 'text' && this.dragElement !== '') {
868
864
  parent.notify('shape', { prop: 'updateFontRatio', onPropertyChange: false,
869
865
  value: { obj: parent.activeObj, isTextArea: null } });
@@ -1062,8 +1058,8 @@ var Selection = /** @class */ (function () {
1062
1058
  parent.activeObj.activePoint.width = parent.activeObj.activePoint.endX - parent.activeObj.activePoint.startX;
1063
1059
  parent.activeObj.activePoint.height = parent.activeObj.activePoint.endY - parent.activeObj.activePoint.startY;
1064
1060
  var currentShapeSettings = this.updatePrevShapeSettings();
1065
- shapeResizingArgs.currentShapeSettings = currentShapeSettings;
1066
- shapeMovingArgs.currentShapeSettings = currentShapeSettings;
1061
+ shapeResizingArgs.currentShapeSettings = this.shapeResizingArgs.currentShapeSettings = currentShapeSettings;
1062
+ shapeMovingArgs.currentShapeSettings = this.shapeMovingArgs.currentShapeSettings = currentShapeSettings;
1067
1063
  if (type === 'resize') {
1068
1064
  this.isCropSelection = false;
1069
1065
  var splitWords = void 0;
@@ -1074,7 +1070,7 @@ var Selection = /** @class */ (function () {
1074
1070
  this.isCropSelection = true;
1075
1071
  }
1076
1072
  if (!this.isCropSelection && this.parent.eventType !== 'resize' && isBlazor() && parent.events && this.parent.events.onShapeResizeStart.hasDelegate === true) {
1077
- shapeResizingArgs.action = 'resize-start';
1073
+ shapeResizingArgs.action = this.currentDrawingShape !== '' ? 'drawing' : 'resize-start';
1078
1074
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1079
1075
  parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShapeResizeStart', shapeResizingArgs).then(function (shapeResizingArgs) {
1080
1076
  parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
@@ -1082,6 +1078,9 @@ var Selection = /** @class */ (function () {
1082
1078
  });
1083
1079
  }
1084
1080
  else if (!this.isCropSelection) {
1081
+ if (this.currentDrawingShape !== '') {
1082
+ shapeResizingArgs.action = 'drawing';
1083
+ }
1085
1084
  parent.trigger('shapeChanging', shapeResizingArgs);
1086
1085
  parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
1087
1086
  value: { shapeSettings: shapeResizingArgs.currentShapeSettings } });
@@ -1098,9 +1097,7 @@ var Selection = /** @class */ (function () {
1098
1097
  startY: shapeResizingArgs.currentShapeSettings.startY,
1099
1098
  width: shapeResizingArgs.currentShapeSettings.width,
1100
1099
  height: shapeResizingArgs.currentShapeSettings.height } };
1101
- if (isNullOrUndefined(this.selectionResizingArgs)) {
1102
- this.selectionResizingArgs = selectionResizingArgs;
1103
- }
1100
+ this.selectionResizingArgs = selectionResizingArgs;
1104
1101
  if (isBlazor() && isNullOrUndefined(this.parent.eventType) && parent.events &&
1105
1102
  parent.events.onSelectionResizeStart.hasDelegate === true) {
1106
1103
  selectionResizingArgs.action = 'resize-start';
@@ -3012,7 +3009,7 @@ var Selection = /** @class */ (function () {
3012
3009
  else if (this.parent.eventType === 'resize') {
3013
3010
  if (!this.isCropSelection && this.parent.events && this.parent.events.onShapeResizeEnd.hasDelegate === true) {
3014
3011
  this.shapeResizingArgs.currentShapeSettings = this.updatePrevShapeSettings();
3015
- this.shapeResizingArgs.action = 'resize-end';
3012
+ this.shapeResizingArgs.action = this.currentDrawingShape !== '' ? 'drawing' : 'resize-end';
3016
3013
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3017
3014
  this.parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShapeResizeEnd', this.shapeResizingArgs).then(function (shapeResizingArgs) {
3018
3015
  _this.parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
@@ -3431,7 +3428,8 @@ var Selection = /** @class */ (function () {
3431
3428
  isApply = false;
3432
3429
  }
3433
3430
  else if (parent.upperCanvas.style.cursor !== 'default' && parent.upperCanvas.style.cursor !== 'grab' &&
3434
- parent.upperCanvas.style.cursor !== 'crosshair' && parent.upperCanvas.style.cursor !== 'pointer') {
3431
+ parent.upperCanvas.style.cursor !== 'crosshair' && parent.upperCanvas.style.cursor !== 'pointer' &&
3432
+ parent.upperCanvas.style.cursor !== 'move') {
3435
3433
  isApply = false;
3436
3434
  }
3437
3435
  else {
@@ -4178,9 +4176,20 @@ var Selection = /** @class */ (function () {
4178
4176
  if (isNullOrUndefined(actObj.activePoint)) {
4179
4177
  return;
4180
4178
  }
4181
- if ((x >= Math.floor(actObj.activePoint.startX) && x <= Math.ceil(actObj.activePoint.endX) &&
4182
- y >= Math.floor(actObj.activePoint.startY) && y <= Math.ceil(actObj.activePoint.endY))) {
4179
+ var radius = actObj.topLeftCircle ? actObj.topLeftCircle.radius : 0;
4180
+ if ((x >= Math.floor(actObj.activePoint.startX) &&
4181
+ x <= Math.ceil(actObj.activePoint.endX) &&
4182
+ y >= Math.floor(actObj.activePoint.startY) &&
4183
+ y <= Math.ceil(actObj.activePoint.endY))) {
4184
+ isInside = true;
4185
+ }
4186
+ else if (radius !== 0 && (x >= Math.floor(actObj.activePoint.startX) - radius &&
4187
+ x <= Math.ceil(actObj.activePoint.endX) + radius &&
4188
+ y >= Math.floor(actObj.activePoint.startY) - radius &&
4189
+ y <= Math.ceil(actObj.activePoint.endY) + radius)) {
4183
4190
  isInside = true;
4191
+ this.tempActiveObj = { activePoint: { startX: 0, startY: 0, endX: 0, endY: 0, width: 0, height: 0 },
4192
+ flipObjColl: [], triangle: [], triangleRatio: [] };
4184
4193
  }
4185
4194
  else if (actObj.shape === 'text' && this.dragElement !== '') {
4186
4195
  isInside = true;
@@ -4270,7 +4279,9 @@ var Selection = /** @class */ (function () {
4270
4279
  Selection.prototype.setTextBoxStylesToActObj = function () {
4271
4280
  var parent = this.parent;
4272
4281
  parent.activeObj.textSettings.fontFamily = parent.textArea.style.fontFamily;
4273
- parent.activeObj.strokeSettings.strokeColor = parent.textArea.style.color !== '' ?
4282
+ parent.activeObj.strokeSettings.strokeColor = parent.textArea.style.color !== '' &&
4283
+ parent.textArea.style.color.split('(')[1] && parent.textArea.style.color.split('(')[1].split(',')[0] &&
4284
+ parent.textArea.style.color.split('(')[1].split(',')[1] && parent.textArea.style.color.split('(')[1].split(',')[2] ?
4274
4285
  this.rgbToHex(parseFloat(parent.textArea.style.color.split('(')[1].split(',')[0]), parseFloat(parent.textArea.style.color.split('(')[1].split(',')[1]), parseFloat(parent.textArea.style.color.split('(')[1].split(',')[2])) :
4275
4286
  parent.textArea.style.color;
4276
4287
  if (parent.textArea.style.fontWeight === 'bold') {
@@ -565,6 +565,9 @@ var Shape = /** @class */ (function () {
565
565
  isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
566
566
  parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
567
567
  }
568
+ else {
569
+ parent.updateToolbar(parent.element, 'text');
570
+ }
568
571
  };
569
572
  Shape.prototype.initializeTextShape = function (text, fontFamily, fontSize, bold, italic, strokeColor) {
570
573
  var parent = this.parent;
@@ -596,14 +599,10 @@ var Shape = /** @class */ (function () {
596
599
  if (x && y) {
597
600
  if ((x !== parent.activeObj.activePoint.startX) && (y !== parent.activeObj.activePoint.startY)) {
598
601
  this.updateTextFromTextArea();
599
- this.applyActObj();
600
602
  }
601
603
  }
602
604
  else {
603
605
  this.updateTextFromTextArea();
604
- this.apply(parent.activeObj.shape, parent.activeObj);
605
- parent.objColl.push(parent.activeObj);
606
- this.refreshActiveObj();
607
606
  parent.textArea.style.transform = '';
608
607
  parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
609
608
  }
@@ -706,7 +705,7 @@ var Shape = /** @class */ (function () {
706
705
  parent.activeObj.strokeSettings.fillColor = shapeSettings.fillColor;
707
706
  switch (parent.activeObj.shape) {
708
707
  case 'ellipse':
709
- parent.activeObj.activePoint.width = shapeSettings.radius / 2;
708
+ parent.activeObj.activePoint.width = shapeSettings.radius * 2;
710
709
  break;
711
710
  case 'line':
712
711
  case 'arrow':
@@ -782,23 +781,20 @@ var Shape = /** @class */ (function () {
782
781
  };
783
782
  Shape.prototype.updateTextFromTextArea = function () {
784
783
  var parent = this.parent;
784
+ var allowUndoRedo = false;
785
+ var prevCropObj = extend({}, parent.cropObj, {}, true);
786
+ var object = { currObj: {} };
787
+ parent.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
788
+ var prevObj = object['currObj'];
789
+ prevObj.objColl = extend([], parent.objColl, [], true);
790
+ prevObj.pointColl = extend([], parent.pointColl, [], true);
791
+ prevObj.afterCropActions = extend([], this.parent.afterCropActions, [], true);
792
+ var selPointCollObj = { selPointColl: null };
793
+ parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
794
+ value: { obj: selPointCollObj } });
795
+ prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
785
796
  if (parent.activeObj.keyHistory !== parent.textArea.value) {
786
- var prevCropObj = extend({}, parent.cropObj, {}, true);
787
- var object = { currObj: {} };
788
- parent.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
789
- var prevObj = object['currObj'];
790
- prevObj.objColl = extend([], parent.objColl, [], true);
791
- prevObj.pointColl = extend([], parent.pointColl, [], true);
792
- prevObj.afterCropActions = extend([], this.parent.afterCropActions, [], true);
793
- var selPointCollObj = { selPointColl: null };
794
- parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
795
- value: { obj: selPointCollObj } });
796
- prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
797
- parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
798
- value: { operation: 'text', previousObj: prevObj, previousObjColl: prevObj.objColl,
799
- previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
800
- previousCropObj: prevCropObj, previousText: parent.activeObj.keyHistory,
801
- currentText: parent.textArea.value, previousFilter: null, isCircleCrop: null } });
797
+ allowUndoRedo = true;
802
798
  }
803
799
  parent.activeObj.keyHistory = parent.textArea.value;
804
800
  parent.textArea.style.display = 'none';
@@ -822,6 +818,19 @@ var Shape = /** @class */ (function () {
822
818
  parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: parent.activeObj.activePoint, obj: parent.activeObj,
823
819
  isMouseMove: null, x: null, y: null } });
824
820
  this.updImgRatioForActObj();
821
+ if (allowUndoRedo) {
822
+ this.apply(parent.activeObj.shape, parent.activeObj);
823
+ parent.objColl.push(extend({}, parent.activeObj, {}, true));
824
+ parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
825
+ value: { operation: 'text', previousObj: prevObj, previousObjColl: prevObj.objColl,
826
+ previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
827
+ previousCropObj: prevCropObj, previousText: parent.activeObj.keyHistory,
828
+ currentText: parent.textArea.value, previousFilter: null, isCircleCrop: null } });
829
+ }
830
+ else {
831
+ this.apply(parent.activeObj.shape, parent.activeObj);
832
+ parent.objColl.push(extend({}, parent.activeObj, {}, true));
833
+ }
825
834
  };
826
835
  Shape.prototype.iterateObjColl = function () {
827
836
  var parent = this.parent;
@@ -1490,11 +1499,13 @@ var Shape = /** @class */ (function () {
1490
1499
  parent.activeObj.pointColl.pop();
1491
1500
  }
1492
1501
  this.updatePathRatio(parent.activeObj);
1502
+ parent.objColl.push(parent.activeObj);
1493
1503
  parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
1494
1504
  value: { operation: 'shapeTransform', previousObj: prevObj, previousObjColl: prevObj.objColl,
1495
1505
  previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
1496
1506
  previousCropObj: prevCropObj, previousText: null,
1497
1507
  currentText: null, previousFilter: null, isCircleCrop: null } });
1508
+ parent.objColl.pop();
1498
1509
  parent.notify('selection', { prop: 'mouseUpEventHandler', value: { e: e } });
1499
1510
  parent.notify('draw', { prop: 'setNewPath', value: { bool: true } });
1500
1511
  if (parent.objColl[parent.objColl.length - 1]) {
@@ -1916,8 +1927,7 @@ var Shape = /** @class */ (function () {
1916
1927
  var object = { arrowDimension: null };
1917
1928
  parent.notify('draw', { prop: 'getArrowDimension', onPropertyChange: false, value: { obj: object } });
1918
1929
  var length;
1919
- var degree = this.getRotDegOfShape(obj);
1920
- if (degree === 0 || degree === 180 || degree === -180) {
1930
+ if (Math.abs(obj.activePoint.width) > Math.abs(obj.activePoint.height)) {
1921
1931
  length = Math.abs(obj.activePoint.width);
1922
1932
  }
1923
1933
  else {
@@ -1937,8 +1947,7 @@ var Shape = /** @class */ (function () {
1937
1947
  var object = { arrowDimension: null };
1938
1948
  this.parent.notify('draw', { prop: 'getArrowDimension', onPropertyChange: false, value: { obj: object } });
1939
1949
  var length;
1940
- var degree = this.getRotDegOfShape(obj);
1941
- if (degree === 0 || degree === 180 || degree === -180) {
1950
+ if (Math.abs(obj.activePoint.width) > Math.abs(obj.activePoint.height)) {
1942
1951
  length = Math.abs(obj.activePoint.width);
1943
1952
  }
1944
1953
  else {
@@ -1201,6 +1201,7 @@ var Transform = /** @class */ (function () {
1201
1201
  };
1202
1202
  Transform.prototype.drawPannImage = function (point) {
1203
1203
  var parent = this.parent;
1204
+ var filter = this.lowerContext.filter;
1204
1205
  var destPoints = { startX: parent.img.destLeft, startY: parent.img.destTop, width: parent.img.destWidth,
1205
1206
  height: parent.img.destHeight };
1206
1207
  this.lowerContext.clearRect(0, 0, parent.lowerCanvas.width, parent.lowerCanvas.height);
@@ -1217,6 +1218,7 @@ var Transform = /** @class */ (function () {
1217
1218
  parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
1218
1219
  value: { context: this.lowerContext, isSave: null, isFlip: true } });
1219
1220
  }
1221
+ this.lowerContext.filter = filter;
1220
1222
  parent.notify('draw', { prop: 'updateCurrTransState', onPropertyChange: false,
1221
1223
  value: { type: 'reverse', isPreventDestination: null, isRotatePan: null } });
1222
1224
  parent.img.destLeft = destPoints.startX;
@@ -406,7 +406,7 @@ export interface ImageEditorModel extends ComponentModel{
406
406
  * Specifies the finetune settings option which can be used to perform color adjustments in the image editor control.
407
407
  *
408
408
  * {% codeBlock src='image-editor/finetuneSettings/index.md' %}{% endcodeBlock %}
409
- *
409
+ *
410
410
  * @remarks
411
411
  * A 'FinetuneSettingsModel' value that specifies the the finetune options which are enabled in image editor control.
412
412
  * If the property is not specified, then the default values will be applied for minimum, maximum, and value properties for all finetune options.
@@ -428,7 +428,7 @@ export interface ImageEditorModel extends ComponentModel{
428
428
  * A 'ZoomSettingsModel' value that specifies the the zoom related options which are enabled in image editor control. The default value is null.
429
429
  *
430
430
  * {% codeBlock src='image-editor/zoomSettings/index.md' %}{% endcodeBlock %}
431
- *
431
+ *
432
432
  * @remarks
433
433
  * If the property is not specified, then the default settings will be applied for all the properties available in zoom settings.
434
434
  *
@@ -445,7 +445,7 @@ export interface ImageEditorModel extends ComponentModel{
445
445
  /**
446
446
  * Specifies the selection settings to customize selection.
447
447
  * A 'SelectionSettingsModel' value that specifies the the customization related options which are enabled in image editor control. The default value is null.
448
- *
448
+ *
449
449
  * @remarks
450
450
  * If the property is not specified, then the default settings will be applied for all the properties available in selection settings.
451
451
  *
@@ -550,7 +550,7 @@ export interface ImageEditorModel extends ComponentModel{
550
550
 
551
551
  /**
552
552
  * Event callback that is raised while updating/refreshing the toolbar
553
- *
553
+ *
554
554
  * {% codeBlock src='image-editor/toolbarUpdating/index.md' %}{% endcodeBlock %}
555
555
  *
556
556
  * @event toolbarUpdating
@@ -157,7 +157,8 @@ var ImageEditor = /** @class */ (function (_super) {
157
157
  _this.cropObj = { cropZoom: 0, defaultZoom: 0, totalPannedPoint: { x: 0, y: 0 }, totalPannedClientPoint: { x: 0, y: 0 },
158
158
  totalPannedInternalPoint: { x: 0, y: 0 }, tempFlipPanPoint: { x: 0, y: 0 }, activeObj: {}, rotateFlipColl: [],
159
159
  degree: 0, currFlipState: '', destPoints: { startX: 0, startY: 0, width: 0, height: 0 },
160
- srcPoints: { startX: 0, startY: 0, width: 0, height: 0 }, filter: '', zoomFactor: 0, previousZoomValue: 0 };
160
+ srcPoints: { startX: 0, startY: 0, width: 0, height: 0 }, filter: '', isBrightAdjust: false,
161
+ zoomFactor: 0, previousZoomValue: 0 };
161
162
  // Stored transformations performed after cropping
162
163
  /** @hidden */
163
164
  _this.afterCropActions = [];
@@ -736,7 +737,7 @@ var ImageEditor = /** @class */ (function (_super) {
736
737
  totalPannedInternalPoint: { x: 0, y: 0 }, tempFlipPanPoint: { x: 0, y: 0 }, activeObj: {},
737
738
  rotateFlipColl: [], degree: 0, currFlipState: '', zoomFactor: 0, previousZoomValue: 0,
738
739
  destPoints: { startX: 0, startY: 0, width: 0, height: 0 },
739
- srcPoints: { startX: 0, startY: 0, width: 0, height: 0 }, filter: '' };
740
+ srcPoints: { startX: 0, startY: 0, width: 0, height: 0 }, filter: '', isBrightAdjust: false };
740
741
  this.afterCropActions = [];
741
742
  this.currentFilter = '';
742
743
  var obj_1 = { initialZoomValue: false };
@@ -454,7 +454,6 @@ export interface ImageEditorClickEventArgs {
454
454
  /**
455
455
  * Interface for quick access toolbar for the image.
456
456
  *
457
- * @private
458
457
  */
459
458
  export interface QuickAccessToolbarEventArgs {
460
459
  /**
@@ -583,6 +582,10 @@ export interface CurrentObject {
583
582
  * Specifies the filter for the image in Image Editor.
584
583
  */
585
584
  filter: string;
585
+ /**
586
+ * Specifies the brightness finetune is adjusted or not for the image in Image Editor.
587
+ */
588
+ isBrightAdjust: boolean;
586
589
  /**
587
590
  * Specifies the object collection in Image Editor.
588
591
  */
@@ -1935,7 +1935,6 @@ var ToolbarModule = /** @class */ (function () {
1935
1935
  }
1936
1936
  spanElem_3.className = 'e-pen-stroke-width';
1937
1937
  strokeWidthBtn.appendChild(spanElem_3);
1938
- // eslint-disable-next-line @typescript-eslint/no-this-alias
1939
1938
  var drpDownBtn_2 = new DropDownButton({ items: strokeWidthItems,
1940
1939
  open: function (args) {
1941
1940
  if (Browser.isDevice) {
@@ -2866,6 +2865,9 @@ var ToolbarModule = /** @class */ (function () {
2866
2865
  };
2867
2866
  ToolbarModule.prototype.updateToolbarItems = function () {
2868
2867
  var parent = this.parent;
2868
+ if (!parent.isImageLoaded) {
2869
+ return;
2870
+ }
2869
2871
  var selFillElem = parent.element.querySelector('.e-fill.e-template .e-dropdownbtn-preview');
2870
2872
  var selStrokeElem = parent.element.querySelector('.e-stroke.e-template .e-dropdownbtn-preview');
2871
2873
  var selTextStrokeElem = parent.element.querySelector('.e-text-font-color.e-template .e-dropdownbtn-preview');