@syncfusion/ej2-image-editor 22.1.39 → 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.
- package/CHANGELOG.md +8 -0
- package/dist/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +216 -117
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +216 -117
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/image-editor/action/crop.d.ts +2 -0
- package/src/image-editor/action/crop.js +41 -27
- package/src/image-editor/action/draw.d.ts +1 -2
- package/src/image-editor/action/draw.js +60 -23
- package/src/image-editor/action/export.js +9 -2
- package/src/image-editor/action/filter.js +1 -8
- package/src/image-editor/action/freehand-draw.d.ts +1 -0
- package/src/image-editor/action/freehand-draw.js +38 -13
- package/src/image-editor/action/selection.js +28 -17
- package/src/image-editor/action/shape.js +31 -25
- package/src/image-editor/action/transform.js +2 -0
- package/src/image-editor/base/image-editor-model.d.ts +4 -4
- package/src/image-editor/base/image-editor.js +3 -2
- package/src/image-editor/base/interface.d.ts +4 -1
- package/src/image-editor/renderer/toolbar.js +3 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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 =
|
|
337
|
-
endPoint =
|
|
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
|
-
|
|
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,8 +659,10 @@ 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.activeObj.strokeSettings.strokeColor = parent.pointColl[_this.fhdSelIdx].strokeColor =
|
|
643
|
-
|
|
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
668
|
parent.updateToolbar(parent.element, 'colorToolbar');
|
|
@@ -648,8 +670,10 @@ var FreehandDrawing = /** @class */ (function () {
|
|
|
648
670
|
}
|
|
649
671
|
else {
|
|
650
672
|
parent.trigger('shapeChanging', shapeChangingArgs);
|
|
651
|
-
parent.activeObj.strokeSettings.strokeColor = parent.pointColl[this.fhdSelIdx].strokeColor =
|
|
652
|
-
|
|
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;
|
|
653
677
|
parent.pointColl[this.fhdSelIdx].points = shapeChangingArgs.currentShapeSettings.points;
|
|
654
678
|
this.freehandRedraw(this.upperContext);
|
|
655
679
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
|
|
@@ -968,6 +992,7 @@ var FreehandDrawing = /** @class */ (function () {
|
|
|
968
992
|
var parent = this.parent;
|
|
969
993
|
if (value) {
|
|
970
994
|
parent.points = [];
|
|
995
|
+
this.dummyPoints = [];
|
|
971
996
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
972
997
|
parent.togglePen = true;
|
|
973
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
|
-
|
|
862
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4182
|
-
|
|
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') {
|
|
@@ -599,14 +599,10 @@ var Shape = /** @class */ (function () {
|
|
|
599
599
|
if (x && y) {
|
|
600
600
|
if ((x !== parent.activeObj.activePoint.startX) && (y !== parent.activeObj.activePoint.startY)) {
|
|
601
601
|
this.updateTextFromTextArea();
|
|
602
|
-
this.applyActObj();
|
|
603
602
|
}
|
|
604
603
|
}
|
|
605
604
|
else {
|
|
606
605
|
this.updateTextFromTextArea();
|
|
607
|
-
this.apply(parent.activeObj.shape, parent.activeObj);
|
|
608
|
-
parent.objColl.push(parent.activeObj);
|
|
609
|
-
this.refreshActiveObj();
|
|
610
606
|
parent.textArea.style.transform = '';
|
|
611
607
|
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
612
608
|
}
|
|
@@ -709,7 +705,7 @@ var Shape = /** @class */ (function () {
|
|
|
709
705
|
parent.activeObj.strokeSettings.fillColor = shapeSettings.fillColor;
|
|
710
706
|
switch (parent.activeObj.shape) {
|
|
711
707
|
case 'ellipse':
|
|
712
|
-
parent.activeObj.activePoint.width = shapeSettings.radius
|
|
708
|
+
parent.activeObj.activePoint.width = shapeSettings.radius * 2;
|
|
713
709
|
break;
|
|
714
710
|
case 'line':
|
|
715
711
|
case 'arrow':
|
|
@@ -785,23 +781,20 @@ var Shape = /** @class */ (function () {
|
|
|
785
781
|
};
|
|
786
782
|
Shape.prototype.updateTextFromTextArea = function () {
|
|
787
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);
|
|
788
796
|
if (parent.activeObj.keyHistory !== parent.textArea.value) {
|
|
789
|
-
|
|
790
|
-
var object = { currObj: {} };
|
|
791
|
-
parent.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
|
|
792
|
-
var prevObj = object['currObj'];
|
|
793
|
-
prevObj.objColl = extend([], parent.objColl, [], true);
|
|
794
|
-
prevObj.pointColl = extend([], parent.pointColl, [], true);
|
|
795
|
-
prevObj.afterCropActions = extend([], this.parent.afterCropActions, [], true);
|
|
796
|
-
var selPointCollObj = { selPointColl: null };
|
|
797
|
-
parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
798
|
-
value: { obj: selPointCollObj } });
|
|
799
|
-
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
800
|
-
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
801
|
-
value: { operation: 'text', previousObj: prevObj, previousObjColl: prevObj.objColl,
|
|
802
|
-
previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
|
|
803
|
-
previousCropObj: prevCropObj, previousText: parent.activeObj.keyHistory,
|
|
804
|
-
currentText: parent.textArea.value, previousFilter: null, isCircleCrop: null } });
|
|
797
|
+
allowUndoRedo = true;
|
|
805
798
|
}
|
|
806
799
|
parent.activeObj.keyHistory = parent.textArea.value;
|
|
807
800
|
parent.textArea.style.display = 'none';
|
|
@@ -825,6 +818,19 @@ var Shape = /** @class */ (function () {
|
|
|
825
818
|
parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: parent.activeObj.activePoint, obj: parent.activeObj,
|
|
826
819
|
isMouseMove: null, x: null, y: null } });
|
|
827
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
|
+
}
|
|
828
834
|
};
|
|
829
835
|
Shape.prototype.iterateObjColl = function () {
|
|
830
836
|
var parent = this.parent;
|
|
@@ -1493,11 +1499,13 @@ var Shape = /** @class */ (function () {
|
|
|
1493
1499
|
parent.activeObj.pointColl.pop();
|
|
1494
1500
|
}
|
|
1495
1501
|
this.updatePathRatio(parent.activeObj);
|
|
1502
|
+
parent.objColl.push(parent.activeObj);
|
|
1496
1503
|
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
1497
1504
|
value: { operation: 'shapeTransform', previousObj: prevObj, previousObjColl: prevObj.objColl,
|
|
1498
1505
|
previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
|
|
1499
1506
|
previousCropObj: prevCropObj, previousText: null,
|
|
1500
1507
|
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
1508
|
+
parent.objColl.pop();
|
|
1501
1509
|
parent.notify('selection', { prop: 'mouseUpEventHandler', value: { e: e } });
|
|
1502
1510
|
parent.notify('draw', { prop: 'setNewPath', value: { bool: true } });
|
|
1503
1511
|
if (parent.objColl[parent.objColl.length - 1]) {
|
|
@@ -1919,8 +1927,7 @@ var Shape = /** @class */ (function () {
|
|
|
1919
1927
|
var object = { arrowDimension: null };
|
|
1920
1928
|
parent.notify('draw', { prop: 'getArrowDimension', onPropertyChange: false, value: { obj: object } });
|
|
1921
1929
|
var length;
|
|
1922
|
-
|
|
1923
|
-
if (degree === 0 || degree === 180 || degree === -180) {
|
|
1930
|
+
if (Math.abs(obj.activePoint.width) > Math.abs(obj.activePoint.height)) {
|
|
1924
1931
|
length = Math.abs(obj.activePoint.width);
|
|
1925
1932
|
}
|
|
1926
1933
|
else {
|
|
@@ -1940,8 +1947,7 @@ var Shape = /** @class */ (function () {
|
|
|
1940
1947
|
var object = { arrowDimension: null };
|
|
1941
1948
|
this.parent.notify('draw', { prop: 'getArrowDimension', onPropertyChange: false, value: { obj: object } });
|
|
1942
1949
|
var length;
|
|
1943
|
-
|
|
1944
|
-
if (degree === 0 || degree === 180 || degree === -180) {
|
|
1950
|
+
if (Math.abs(obj.activePoint.width) > Math.abs(obj.activePoint.height)) {
|
|
1945
1951
|
length = Math.abs(obj.activePoint.width);
|
|
1946
1952
|
}
|
|
1947
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: '',
|
|
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');
|