@syncfusion/ej2-image-editor 22.2.10 → 23.1.36
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 +18 -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 +4272 -687
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +4234 -640
- 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 +12 -12
- package/src/image-editor/action/crop.js +47 -30
- package/src/image-editor/action/draw.d.ts +16 -0
- package/src/image-editor/action/draw.js +827 -81
- package/src/image-editor/action/export.d.ts +3 -0
- package/src/image-editor/action/export.js +84 -20
- package/src/image-editor/action/filter.d.ts +0 -1
- package/src/image-editor/action/filter.js +28 -41
- package/src/image-editor/action/freehand-draw.js +45 -32
- package/src/image-editor/action/selection.d.ts +6 -0
- package/src/image-editor/action/selection.js +380 -66
- package/src/image-editor/action/shape.d.ts +8 -0
- package/src/image-editor/action/shape.js +286 -91
- package/src/image-editor/action/transform.d.ts +9 -0
- package/src/image-editor/action/transform.js +402 -52
- package/src/image-editor/action/undo-redo.d.ts +1 -0
- package/src/image-editor/action/undo-redo.js +138 -10
- package/src/image-editor/base/enum.d.ts +38 -1
- package/src/image-editor/base/enum.js +39 -0
- package/src/image-editor/base/image-editor-model.d.ts +16 -2
- package/src/image-editor/base/image-editor.d.ts +134 -7
- package/src/image-editor/base/image-editor.js +611 -69
- package/src/image-editor/base/interface.d.ts +233 -2
- package/src/image-editor/renderer/toolbar.d.ts +25 -0
- package/src/image-editor/renderer/toolbar.js +1273 -72
- package/styles/bootstrap-dark.css +68 -1
- package/styles/bootstrap.css +68 -1
- package/styles/bootstrap4.css +68 -1
- package/styles/bootstrap5-dark.css +68 -1
- package/styles/bootstrap5.css +68 -1
- package/styles/fabric-dark.css +68 -1
- package/styles/fabric.css +68 -1
- package/styles/fluent-dark.css +68 -1
- package/styles/fluent.css +68 -1
- package/styles/highcontrast-light.css +70 -3
- package/styles/highcontrast.css +69 -7
- package/styles/image-editor/_bootstrap-dark-definition.scss +1 -0
- package/styles/image-editor/_bootstrap-definition.scss +1 -0
- package/styles/image-editor/_bootstrap4-definition.scss +1 -0
- package/styles/image-editor/_bootstrap5-definition.scss +1 -0
- package/styles/image-editor/_fabric-dark-definition.scss +1 -0
- package/styles/image-editor/_fabric-definition.scss +1 -0
- package/styles/image-editor/_fluent-definition.scss +1 -0
- package/styles/image-editor/_fusionnew-definition.scss +1 -0
- package/styles/image-editor/_highcontrast-definition.scss +2 -1
- package/styles/image-editor/_highcontrast-light-definition.scss +2 -1
- package/styles/image-editor/_layout.scss +92 -0
- package/styles/image-editor/_material-dark-definition.scss +1 -0
- package/styles/image-editor/_material-definition.scss +1 -0
- package/styles/image-editor/_material3-definition.scss +2 -1
- package/styles/image-editor/_tailwind-definition.scss +1 -0
- package/styles/image-editor/_theme.scss +4 -2
- package/styles/image-editor/bootstrap-dark.css +68 -1
- package/styles/image-editor/bootstrap-dark.scss +1 -1
- package/styles/image-editor/bootstrap.css +68 -1
- package/styles/image-editor/bootstrap.scss +1 -1
- package/styles/image-editor/bootstrap4.css +68 -1
- package/styles/image-editor/bootstrap4.scss +1 -1
- package/styles/image-editor/bootstrap5-dark.css +68 -1
- package/styles/image-editor/bootstrap5-dark.scss +1 -1
- package/styles/image-editor/bootstrap5.css +68 -1
- package/styles/image-editor/bootstrap5.scss +1 -1
- package/styles/image-editor/fabric-dark.css +68 -1
- package/styles/image-editor/fabric-dark.scss +1 -1
- package/styles/image-editor/fabric.css +68 -1
- package/styles/image-editor/fabric.scss +1 -1
- package/styles/image-editor/fluent-dark.css +68 -1
- package/styles/image-editor/fluent-dark.scss +1 -1
- package/styles/image-editor/fluent.css +68 -1
- package/styles/image-editor/fluent.scss +1 -1
- package/styles/image-editor/highcontrast-light.css +70 -3
- package/styles/image-editor/highcontrast-light.scss +1 -1
- package/styles/image-editor/highcontrast.css +69 -7
- package/styles/image-editor/highcontrast.scss +1 -1
- package/styles/image-editor/icons/_bootstrap-dark.scss +1 -0
- package/styles/image-editor/icons/_bootstrap.scss +1 -0
- package/styles/image-editor/icons/_bootstrap4.scss +1 -0
- package/styles/image-editor/icons/_bootstrap5.scss +1 -0
- package/styles/image-editor/icons/_fabric-dark.scss +1 -0
- package/styles/image-editor/icons/_fabric.scss +1 -0
- package/styles/image-editor/icons/_fluent.scss +1 -0
- package/styles/image-editor/icons/_fusionnew.scss +1 -0
- package/styles/image-editor/icons/_highcontrast-light.scss +1 -0
- package/styles/image-editor/icons/_highcontrast.scss +1 -0
- package/styles/image-editor/icons/_material-dark.scss +1 -0
- package/styles/image-editor/icons/_material.scss +1 -0
- package/styles/image-editor/icons/_material3.scss +1 -0
- package/styles/image-editor/icons/_tailwind.scss +1 -0
- package/styles/image-editor/material-dark.css +68 -2
- package/styles/image-editor/material-dark.scss +1 -1
- package/styles/image-editor/material.css +68 -2
- package/styles/image-editor/material.scss +1 -1
- package/styles/image-editor/material3-dark.css +73 -4
- package/styles/image-editor/material3-dark.scss +1 -1
- package/styles/image-editor/material3.css +73 -4
- package/styles/image-editor/material3.scss +1 -1
- package/styles/image-editor/tailwind-dark.css +68 -2
- package/styles/image-editor/tailwind-dark.scss +1 -1
- package/styles/image-editor/tailwind.css +68 -2
- package/styles/image-editor/tailwind.scss +1 -1
- package/styles/material-dark.css +68 -2
- package/styles/material.css +68 -2
- package/styles/material3-dark.css +73 -4
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +73 -4
- package/styles/material3.scss +1 -1
- package/styles/tailwind-dark.css +68 -2
- package/styles/tailwind.css +68 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 23.1.36
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-image-editor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-image-editor@
|
|
3
|
+
"_id": "@syncfusion/ej2-image-editor@20.18.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-y/5mhKXiQuPoGSnd0cKEjsAtldx4Im5PvldVEM96ccVUBeTfC/wOOmCMl1cOkWzwzNEgpkQoES9xFqC1Xht6EA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-image-editor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-image-editor",
|
|
24
24
|
"/@syncfusion/ej2-vue-image-editor"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-image-editor/-/ej2-image-editor-20.18.0.tgz",
|
|
27
|
+
"_shasum": "7f64d41fb7f16402d12e35a546644dd7e73d160f",
|
|
28
28
|
"_spec": "@syncfusion/ej2-image-editor@*",
|
|
29
|
-
"_where": "/jenkins/workspace/elease-
|
|
29
|
+
"_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Syncfusion Inc."
|
|
32
32
|
},
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@syncfusion/ej2-base": "~
|
|
36
|
-
"@syncfusion/ej2-buttons": "~
|
|
37
|
-
"@syncfusion/ej2-inputs": "~
|
|
38
|
-
"@syncfusion/ej2-navigations": "~
|
|
39
|
-
"@syncfusion/ej2-popups": "~
|
|
40
|
-
"@syncfusion/ej2-splitbuttons": "~
|
|
35
|
+
"@syncfusion/ej2-base": "~23.1.36",
|
|
36
|
+
"@syncfusion/ej2-buttons": "~23.1.36",
|
|
37
|
+
"@syncfusion/ej2-inputs": "~23.1.36",
|
|
38
|
+
"@syncfusion/ej2-navigations": "~23.1.36",
|
|
39
|
+
"@syncfusion/ej2-popups": "~23.1.36",
|
|
40
|
+
"@syncfusion/ej2-splitbuttons": "~23.1.36"
|
|
41
41
|
},
|
|
42
42
|
"deprecated": false,
|
|
43
43
|
"description": "Essential JS 2 ImageEditor",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
|
|
68
68
|
},
|
|
69
69
|
"typings": "index.d.ts",
|
|
70
|
-
"version": "
|
|
70
|
+
"version": "23.1.36",
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
73
73
|
}
|
|
@@ -99,12 +99,19 @@ var Crop = /** @class */ (function () {
|
|
|
99
99
|
Crop.prototype.cropImg = function (isRotateCrop) {
|
|
100
100
|
var parent = this.parent;
|
|
101
101
|
var isNullCrop = isNullOrUndefined(isRotateCrop);
|
|
102
|
+
var resizeIcon = this.parent.element.querySelector('#' + this.parent.element.id + '_nonaspectratio');
|
|
102
103
|
var actPoint = parent.activeObj.activePoint;
|
|
104
|
+
var isRotated = false;
|
|
105
|
+
for (var i = 0; i < parent.rotateFlipColl.length; i++) {
|
|
106
|
+
if (parent.rotateFlipColl[i] === 90 || parent.rotateFlipColl[i] === -90) {
|
|
107
|
+
isRotated = true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
103
110
|
parent.notify('draw', { prop: 'setImageEdited', onPropertyChange: false });
|
|
104
|
-
if (isNullCrop) {
|
|
111
|
+
if (isNullCrop || resizeIcon) {
|
|
105
112
|
this.croppedDegree = parent.transform.degree;
|
|
106
113
|
}
|
|
107
|
-
if (isNullCrop && parent.transform.degree !== 0) {
|
|
114
|
+
if (isNullCrop && (parent.transform.degree !== 0) || isRotated) {
|
|
108
115
|
this.updateCropObj();
|
|
109
116
|
var point = { startX: parent.img.destLeft, startY: parent.img.destTop, width: parent.img.destWidth,
|
|
110
117
|
height: parent.img.destHeight };
|
|
@@ -135,7 +142,7 @@ var Crop = /** @class */ (function () {
|
|
|
135
142
|
var obj = { width: 0, height: 0 };
|
|
136
143
|
parent.notify('transform', { prop: 'calcMaxDimension', onPropertyChange: false,
|
|
137
144
|
value: { width: actPoint.width * ratio.width,
|
|
138
|
-
height: actPoint.height * ratio.height, obj: obj } });
|
|
145
|
+
height: actPoint.height * ratio.height, obj: obj, isImgShape: null } });
|
|
139
146
|
var maxDimension = obj;
|
|
140
147
|
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
141
148
|
this.lowerContext.clearRect(0, 0, parent.lowerCanvas.width, parent.lowerCanvas.height);
|
|
@@ -148,8 +155,7 @@ var Crop = /** @class */ (function () {
|
|
|
148
155
|
parent.img.destWidth = maxDimension.width;
|
|
149
156
|
parent.img.destHeight = maxDimension.height;
|
|
150
157
|
var temp = this.lowerContext.filter;
|
|
151
|
-
parent.notify('
|
|
152
|
-
this.lowerContext.drawImage(parent.baseImg, parent.img.srcLeft, parent.img.srcTop, parent.img.srcWidth, parent.img.srcHeight, parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
|
|
158
|
+
parent.notify('draw', { prop: 'drawImage', onPropertyChange: false });
|
|
153
159
|
this.lowerContext.filter = 'none';
|
|
154
160
|
var activeObj = extend({}, parent.activeObj, {}, true);
|
|
155
161
|
this.cropObjColl();
|
|
@@ -166,7 +172,7 @@ var Crop = /** @class */ (function () {
|
|
|
166
172
|
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
167
173
|
parent.notify('draw', { prop: 'clearOuterCanvas', onPropertyChange: false, value: { context: this.lowerContext } });
|
|
168
174
|
parent.notify('draw', { prop: 'clearOuterCanvas', onPropertyChange: false, value: { context: this.upperContext } });
|
|
169
|
-
if (parent.currSelectionPoint.shape === 'crop-circle') {
|
|
175
|
+
if (parent.currSelectionPoint != null && parent.currSelectionPoint.shape === 'crop-circle') {
|
|
170
176
|
this.cropCircle(this.lowerContext);
|
|
171
177
|
}
|
|
172
178
|
else {
|
|
@@ -269,7 +275,7 @@ var Crop = /** @class */ (function () {
|
|
|
269
275
|
for (var i = 0; i < (zoomFactor * 10); i++) {
|
|
270
276
|
parent.isUndoRedo = true;
|
|
271
277
|
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
272
|
-
value: { zoomFactor: -0.1, zoomPoint: null } });
|
|
278
|
+
value: { zoomFactor: -0.1, zoomPoint: null }, isResize: null });
|
|
273
279
|
}
|
|
274
280
|
parent.isUndoRedo = isUndoRedo;
|
|
275
281
|
parent.notify('draw', { prop: 'resetPanPoints', onPropertyChange: false });
|
|
@@ -292,8 +298,7 @@ var Crop = /** @class */ (function () {
|
|
|
292
298
|
this.lowerContext.clearRect(0, 0, parent.lowerCanvas.width, parent.lowerCanvas.height);
|
|
293
299
|
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
294
300
|
var temp = this.lowerContext.filter;
|
|
295
|
-
parent.notify('
|
|
296
|
-
this.lowerContext.drawImage(parent.baseImg, parent.img.srcLeft, parent.img.srcTop, parent.img.srcWidth, parent.img.srcHeight, parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
|
|
301
|
+
parent.notify('draw', { prop: 'drawImage', onPropertyChange: false });
|
|
297
302
|
for (var i = 0, len = parent.objColl.length; i < len; i++) {
|
|
298
303
|
parent.objColl[i].shapeFlip = '';
|
|
299
304
|
}
|
|
@@ -313,8 +318,7 @@ var Crop = /** @class */ (function () {
|
|
|
313
318
|
parent.notify('draw', { prop: 'setDestPoints', onPropertyChange: false });
|
|
314
319
|
parent.notify('draw', { prop: 'currTransState', onPropertyChange: false,
|
|
315
320
|
value: { type: 'initial', isPreventDestination: null, context: null, isPreventCircleCrop: null } });
|
|
316
|
-
parent.notify('
|
|
317
|
-
this.lowerContext.drawImage(parent.baseImg, parent.img.srcLeft, parent.img.srcTop, parent.img.srcWidth, parent.img.srcHeight, parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
|
|
321
|
+
parent.notify('draw', { prop: 'drawImage', onPropertyChange: false });
|
|
318
322
|
this.lowerContext.filter = temp;
|
|
319
323
|
parent.notify('draw', { prop: 'setRotateZoom', onPropertyChange: false, value: { isRotateZoom: false } });
|
|
320
324
|
parent.notify('draw', { prop: 'currTransState', onPropertyChange: false,
|
|
@@ -434,12 +438,13 @@ var Crop = /** @class */ (function () {
|
|
|
434
438
|
};
|
|
435
439
|
Crop.prototype.setCurrSelPoints = function (isSetDimension) {
|
|
436
440
|
var parent = this.parent;
|
|
441
|
+
parent.allowDownScale = false;
|
|
437
442
|
var destPoint = this.cropDestPoints;
|
|
438
443
|
var filter = this.lowerContext.filter;
|
|
439
444
|
parent.img.srcLeft = 0;
|
|
440
445
|
parent.img.srcTop = 0;
|
|
441
|
-
parent.img.srcWidth = parent.
|
|
442
|
-
parent.img.srcHeight = parent.
|
|
446
|
+
parent.img.srcWidth = parent.baseImgCanvas.width;
|
|
447
|
+
parent.img.srcHeight = parent.baseImgCanvas.height;
|
|
443
448
|
parent.img.destLeft = destPoint.startX;
|
|
444
449
|
parent.img.destTop = destPoint.startY;
|
|
445
450
|
parent.img.destWidth = destPoint.width;
|
|
@@ -461,8 +466,7 @@ var Crop = /** @class */ (function () {
|
|
|
461
466
|
parent.img.destLeft += parent.panPoint.totalPannedInternalPoint.x;
|
|
462
467
|
parent.img.destTop += parent.panPoint.totalPannedInternalPoint.y;
|
|
463
468
|
}
|
|
464
|
-
parent.notify('
|
|
465
|
-
this.lowerContext.drawImage(parent.baseImg, parent.img.srcLeft, parent.img.srcTop, parent.img.srcWidth, parent.img.srcHeight, parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
|
|
469
|
+
parent.notify('draw', { prop: 'drawImage', onPropertyChange: false });
|
|
466
470
|
this.lowerContext.filter = filter;
|
|
467
471
|
parent.notify('draw', { prop: 'currTransState', onPropertyChange: false,
|
|
468
472
|
value: { type: 'reverse', isPreventDestination: null, context: null, isPreventCircleCrop: true } });
|
|
@@ -508,7 +512,12 @@ var Crop = /** @class */ (function () {
|
|
|
508
512
|
parent.activeObj = extend({}, actObj, null, true);
|
|
509
513
|
var activeObj = extend({}, parent.activeObj, null, true);
|
|
510
514
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
511
|
-
|
|
515
|
+
parent.currSelectionPoint = null;
|
|
516
|
+
parent.isCircleCrop = false;
|
|
517
|
+
if (parent.transform.degree !== 0) {
|
|
518
|
+
parent.notify('transform', { prop: 'drawPannedImage', value: { xDiff: 0, yDiff: 0 } });
|
|
519
|
+
parent.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
520
|
+
}
|
|
512
521
|
parent.objColl = cropObjColl;
|
|
513
522
|
parent.pointColl = cropPointColl;
|
|
514
523
|
parent.freehandCounter = parent.pointColl.length;
|
|
@@ -520,7 +529,6 @@ var Crop = /** @class */ (function () {
|
|
|
520
529
|
parent.notify('freehand-draw', { prop: 'updateFHDColl', onPropertyChange: false });
|
|
521
530
|
parent.notify('shape', { prop: 'zoomObjColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
522
531
|
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
523
|
-
parent.currSelectionPoint = null;
|
|
524
532
|
if (parent.transform.degree === 0) {
|
|
525
533
|
parent.notify('transform', { prop: 'drawPannImage', onPropertyChange: false,
|
|
526
534
|
value: { point: { x: 0, y: 0 } } });
|
|
@@ -552,8 +560,6 @@ var Crop = /** @class */ (function () {
|
|
|
552
560
|
};
|
|
553
561
|
Crop.prototype.panToSelRangle = function (isReverse) {
|
|
554
562
|
var parent = this.parent;
|
|
555
|
-
var obj = extend({}, parent.currSelectionPoint, null, true);
|
|
556
|
-
parent.currSelectionPoint = null;
|
|
557
563
|
var panX = parent.transform.degree !== 0 ?
|
|
558
564
|
isReverse ? -parent.cropObj.totalPannedClientPoint.x : parent.cropObj.totalPannedClientPoint.x : 0;
|
|
559
565
|
var panY = parent.transform.degree !== 0 ?
|
|
@@ -563,7 +569,6 @@ var Crop = /** @class */ (function () {
|
|
|
563
569
|
parent.notify('transform', { prop: 'drawPannedImage', value: { xDiff: panX, yDiff: panY } });
|
|
564
570
|
parent.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
565
571
|
}
|
|
566
|
-
parent.currSelectionPoint = obj;
|
|
567
572
|
};
|
|
568
573
|
Crop.prototype.cropCircle = function (context, isSave, isFlip) {
|
|
569
574
|
var parent = this.parent;
|
|
@@ -571,6 +576,8 @@ var Crop = /** @class */ (function () {
|
|
|
571
576
|
parent.notify('draw', { prop: 'setTransform', onPropertyChange: false,
|
|
572
577
|
value: { context: context, value: parent.transform.currFlipState, isReverse: null } });
|
|
573
578
|
}
|
|
579
|
+
var temp = context.filter;
|
|
580
|
+
context.filter = 'none';
|
|
574
581
|
context.globalCompositeOperation = 'destination-in';
|
|
575
582
|
context.beginPath();
|
|
576
583
|
var centerX = isNullOrUndefined(isSave) ? parent.img.destLeft + (parent.img.destWidth / 2) : context.canvas.width / 2;
|
|
@@ -582,6 +589,7 @@ var Crop = /** @class */ (function () {
|
|
|
582
589
|
context.restore();
|
|
583
590
|
context.globalCompositeOperation = 'source-over';
|
|
584
591
|
parent.currObjType.isActiveObj = parent.isCircleCrop = true;
|
|
592
|
+
context.filter = temp;
|
|
585
593
|
if (isFlip && parent.transform.currFlipState !== '') {
|
|
586
594
|
parent.notify('draw', { prop: 'setTransform', onPropertyChange: false,
|
|
587
595
|
value: { context: context, value: parent.transform.currFlipState, isReverse: null } });
|
|
@@ -722,10 +730,16 @@ var Crop = /** @class */ (function () {
|
|
|
722
730
|
y: parent.activeObj.activePoint.startY }, endPoint: { x: parent.activeObj.activePoint.endX,
|
|
723
731
|
y: parent.activeObj.activePoint.endY }, preventScaling: false };
|
|
724
732
|
if (!object_1['isCropToolbar'] && isBlazor() && parent.events && parent.events.cropping.hasDelegate === true) {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}
|
|
733
|
+
if (parent.currentToolbar == 'resize-toolbar') {
|
|
734
|
+
parent.dotNetRef.invokeMethodAsync('CropEventAsync', 'OnCrop', transitionArgs);
|
|
735
|
+
this.cropEvent(transitionArgs, obj, object_1);
|
|
736
|
+
}
|
|
737
|
+
else {
|
|
738
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
739
|
+
parent.dotNetRef.invokeMethodAsync('CropEventAsync', 'OnCrop', transitionArgs).then(function (args) {
|
|
740
|
+
_this.cropEvent(args, obj, object_1);
|
|
741
|
+
});
|
|
742
|
+
}
|
|
729
743
|
}
|
|
730
744
|
else {
|
|
731
745
|
if (!object_1['isCropToolbar']) {
|
|
@@ -769,11 +783,14 @@ var Crop = /** @class */ (function () {
|
|
|
769
783
|
}
|
|
770
784
|
parent.notify('transform', { prop: 'setCropDimension', onPropertyChange: false,
|
|
771
785
|
value: { width: parent.cropObj.destPoints.width, height: parent.cropObj.destPoints.height } });
|
|
772
|
-
|
|
786
|
+
var aspectIcon = this.parent.element.querySelector('#' + this.parent.element.id + '_aspectratio');
|
|
787
|
+
var nonAspectIcon = this.parent.element.querySelector('#' + this.parent.element.id + '_nonaspectratio');
|
|
788
|
+
if (!isBlazor() && !object['isCropToolbar'] && (isNullOrUndefined(aspectIcon) && isNullOrUndefined(nonAspectIcon))) {
|
|
773
789
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
|
|
774
790
|
isApplyBtn: false, isCropping: false, isZooming: null, cType: null } });
|
|
791
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
775
792
|
}
|
|
776
|
-
else if (!object['isCropToolbar']) {
|
|
793
|
+
else if (!object['isCropToolbar'] && this.parent.currentToolbar !== 'resize-toolbar') {
|
|
777
794
|
this.parent.updateToolbar(this.parent.element, 'imageLoaded');
|
|
778
795
|
}
|
|
779
796
|
}
|
|
@@ -784,12 +801,12 @@ var Crop = /** @class */ (function () {
|
|
|
784
801
|
var widthRatio;
|
|
785
802
|
var heightRatio;
|
|
786
803
|
if (parent.transform.degree === 0 || parent.transform.degree % 180 === 0) {
|
|
787
|
-
widthRatio = (dimension ? dimension.width : parent.
|
|
788
|
-
heightRatio = (dimension ? dimension.height : parent.
|
|
804
|
+
widthRatio = (dimension ? dimension.width : parent.baseImgCanvas.width) / parent.img.destWidth;
|
|
805
|
+
heightRatio = (dimension ? dimension.height : parent.baseImgCanvas.height) / parent.img.destHeight;
|
|
789
806
|
}
|
|
790
807
|
else {
|
|
791
|
-
widthRatio = (dimension ? dimension.height : parent.
|
|
792
|
-
heightRatio = (dimension ? dimension.width : parent.
|
|
808
|
+
widthRatio = (dimension ? dimension.height : parent.baseImgCanvas.height) / parent.img.destWidth;
|
|
809
|
+
heightRatio = (dimension ? dimension.width : parent.baseImgCanvas.width) / parent.img.destHeight;
|
|
793
810
|
}
|
|
794
811
|
if (obj) {
|
|
795
812
|
obj['width'] = widthRatio;
|
|
@@ -39,7 +39,11 @@ export declare class Draw {
|
|
|
39
39
|
private inputElem;
|
|
40
40
|
private isFileChanged;
|
|
41
41
|
private isNewPath;
|
|
42
|
+
private isResizeSelect;
|
|
42
43
|
private arrowDimension;
|
|
44
|
+
private tempFrame;
|
|
45
|
+
private origDim;
|
|
46
|
+
private isImageApply;
|
|
43
47
|
constructor(parent: ImageEditor);
|
|
44
48
|
destroy(): void;
|
|
45
49
|
private addEventListener;
|
|
@@ -48,6 +52,7 @@ export declare class Draw {
|
|
|
48
52
|
getModuleName(): string;
|
|
49
53
|
private updatePrivateVariables;
|
|
50
54
|
private reset;
|
|
55
|
+
private drawImage;
|
|
51
56
|
private drawObject;
|
|
52
57
|
private rotateContext;
|
|
53
58
|
private setDragLimit;
|
|
@@ -73,8 +78,10 @@ export declare class Draw {
|
|
|
73
78
|
private arrowCircle;
|
|
74
79
|
private arrowCircleSolid;
|
|
75
80
|
private arrowBar;
|
|
81
|
+
private shapeImage;
|
|
76
82
|
private shapeText;
|
|
77
83
|
private updateActPoint;
|
|
84
|
+
private rotateImage;
|
|
78
85
|
private rotateText;
|
|
79
86
|
private textFlipDegree;
|
|
80
87
|
private clearOuterCanvas;
|
|
@@ -87,7 +94,9 @@ export declare class Draw {
|
|
|
87
94
|
private renderImage;
|
|
88
95
|
private imageOnLoad;
|
|
89
96
|
private errorLoading;
|
|
97
|
+
private updateBaseImgCanvas;
|
|
90
98
|
private updateCanvas;
|
|
99
|
+
private resetFrameZoom;
|
|
91
100
|
private performCancel;
|
|
92
101
|
private cancelItems;
|
|
93
102
|
private cancelPen;
|
|
@@ -121,4 +130,11 @@ export declare class Draw {
|
|
|
121
130
|
private moveToSelectionRange;
|
|
122
131
|
private isSelectionBiggerThanCanvas;
|
|
123
132
|
private isSelectionOutsideCanvas;
|
|
133
|
+
private downScaleImgCanvas;
|
|
134
|
+
private downScale;
|
|
135
|
+
private drawImgToCtx;
|
|
136
|
+
private getFrameColor;
|
|
137
|
+
private applyFrame;
|
|
138
|
+
private triggerFrameChange;
|
|
139
|
+
private setFrameObj;
|
|
124
140
|
}
|