@syncfusion/ej2-image-editor 27.1.50 → 27.1.51
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/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 +67 -8
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +66 -7
- 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 +8 -8
- package/src/image-editor/action/draw.js +7 -5
- package/src/image-editor/action/undo-redo.js +10 -0
- package/src/image-editor/renderer/toolbar.js +49 -2
|
@@ -2021,7 +2021,7 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
this.drawArrowHead(canvasDraw, true);
|
|
2023
2023
|
this.drawArrowHead(canvasDraw, false);
|
|
2024
|
-
if (actObj.end === 'none') {
|
|
2024
|
+
if (actObj.end === 'none' && actObj.start !== 'circle' && actObj.start !== 'square') {
|
|
2025
2025
|
this.shapeLine(canvasDraw, actPoint.startX, actPoint.startY, actPoint.endX, actPoint.endY);
|
|
2026
2026
|
}
|
|
2027
2027
|
canvasDraw.fillStyle = tempFillStyle;
|
|
@@ -2425,9 +2425,10 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2425
2425
|
var isStartArrow = actObj.start === 'arrow';
|
|
2426
2426
|
var isEndArrow = actObj.end === 'arrow';
|
|
2427
2427
|
var isEndCircleOrSquare = actObj.end === 'circle' || actObj.end === 'square';
|
|
2428
|
+
var isStartCircleOrSquare = actObj.start === 'circle' || actObj.start === 'square';
|
|
2428
2429
|
if ((start && actObj.triangleDirection === 'left' || actObj.triangleDirection === 'right') &&
|
|
2429
|
-
((isStartArrow && actObj.end === 'none') || (isStartArrow && !isEndCircleOrSquare)) ||
|
|
2430
|
-
(!start && (isEndArrow && actObj.start === 'none' || !isStartArrow && !isEndCircleOrSquare))) {
|
|
2430
|
+
((isStartArrow && actObj.end === 'none') || (isStartArrow && !isEndCircleOrSquare && !isStartCircleOrSquare)) ||
|
|
2431
|
+
(!start && (isEndArrow && actObj.start === 'none' || !isStartArrow && !isEndCircleOrSquare && !isStartCircleOrSquare))) {
|
|
2431
2432
|
this.shapeLine(canvasDraw, startX, startY, endX, endY);
|
|
2432
2433
|
}
|
|
2433
2434
|
if ((start && actObj.triangleDirection === 'left') || (!start && actObj.triangleDirection === 'right')) {
|
|
@@ -2462,9 +2463,10 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2462
2463
|
var angle = Math.atan2(this.dy, this.dx);
|
|
2463
2464
|
var isStartArrowSolid = actObj.start === 'arrowSolid';
|
|
2464
2465
|
var isEndArrowSolid = actObj.end === 'arrowSolid';
|
|
2466
|
+
var isStartCircleOrSquare = actObj.start === 'circle' || actObj.start === 'square';
|
|
2465
2467
|
var isEndCircleOrSquare = actObj.end === 'circle' || actObj.end === 'square';
|
|
2466
|
-
if ((start && (isStartArrowSolid && actObj.end === 'none') || (isStartArrowSolid && !isEndCircleOrSquare)) ||
|
|
2467
|
-
(!start && (isEndArrowSolid && actObj.start === 'none' || !isStartArrowSolid && !isEndCircleOrSquare))) {
|
|
2468
|
+
if ((start && (isStartArrowSolid && actObj.end === 'none') || (isStartArrowSolid && !isEndCircleOrSquare && !isStartCircleOrSquare)) ||
|
|
2469
|
+
(!start && (isEndArrowSolid && actObj.start === 'none' || !isStartArrowSolid && !isEndCircleOrSquare && !isStartCircleOrSquare))) {
|
|
2468
2470
|
this.shapeLine(canvasDraw, startX, startY, endX, endY);
|
|
2469
2471
|
}
|
|
2470
2472
|
if ((start && actObj.triangleDirection === 'left') || (!start && actObj.triangleDirection === 'right')) {
|
|
@@ -21562,12 +21564,22 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
21562
21564
|
var parent = this.parent;
|
|
21563
21565
|
for (var i = 0; i < parent.objColl.length; i++) {
|
|
21564
21566
|
var obj = parent.objColl[i];
|
|
21567
|
+
var isUpdated = false;
|
|
21565
21568
|
if (obj.shape === 'line' || obj.shape === 'arrow') {
|
|
21566
21569
|
if (obj.activePoint.width < 0) {
|
|
21567
21570
|
obj.activePoint.width = Math.abs(obj.activePoint.width);
|
|
21571
|
+
isUpdated = true;
|
|
21568
21572
|
}
|
|
21569
21573
|
if (obj.activePoint.height < 0) {
|
|
21570
21574
|
obj.activePoint.height = Math.abs(obj.activePoint.height);
|
|
21575
|
+
isUpdated = true;
|
|
21576
|
+
}
|
|
21577
|
+
if (isUpdated) {
|
|
21578
|
+
var activeObj = extend({}, parent.activeObj, {}, true);
|
|
21579
|
+
parent.activeObj = obj;
|
|
21580
|
+
parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
|
|
21581
|
+
obj = parent.activeObj;
|
|
21582
|
+
parent.activeObj = activeObj;
|
|
21571
21583
|
}
|
|
21572
21584
|
}
|
|
21573
21585
|
}
|
|
@@ -27782,6 +27794,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27782
27794
|
zOrderElement.classList.remove('e-overlay');
|
|
27783
27795
|
}
|
|
27784
27796
|
}
|
|
27797
|
+
if (zOrderElement && (parent.shapeColl.length === 0 || (obj['freehandDrawSelectedId'] && parent.shapeColl.length === 1))) {
|
|
27798
|
+
zOrderElement.classList.add('e-overlay');
|
|
27799
|
+
}
|
|
27785
27800
|
};
|
|
27786
27801
|
ToolbarModule.prototype.renderStraightenSlider = function () {
|
|
27787
27802
|
var parent = this.parent;
|
|
@@ -28251,11 +28266,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
28251
28266
|
fileSize = Math.floor(blob.size / 1024);
|
|
28252
28267
|
if (fileSize > 1000) {
|
|
28253
28268
|
var megabytes = fileSize / 1024;
|
|
28254
|
-
imageNameLabel.innerHTML = '
|
|
28269
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
28255
28270
|
fileSize = +megabytes.toFixed(2);
|
|
28256
28271
|
}
|
|
28257
28272
|
else {
|
|
28258
|
-
imageNameLabel.innerHTML = '
|
|
28273
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize.toFixed(2) + ' KB';
|
|
28259
28274
|
fileSize = +fileSize.toFixed(2);
|
|
28260
28275
|
}
|
|
28261
28276
|
if (Browser.isDevice) {
|
|
@@ -28273,6 +28288,50 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
28273
28288
|
this.fileSize = fileSize;
|
|
28274
28289
|
}).bind(this), 'image/jpeg', quality);
|
|
28275
28290
|
}
|
|
28291
|
+
else if (!isNullOrUndefined(fileType) && fileType.toLowerCase() === 'png') {
|
|
28292
|
+
if (Browser.isDevice) {
|
|
28293
|
+
canvas.style.display = 'none';
|
|
28294
|
+
}
|
|
28295
|
+
else {
|
|
28296
|
+
ctx.drawImage(tempCanvas, 0, 0);
|
|
28297
|
+
tempCanvas.toBlob((function (blob) {
|
|
28298
|
+
fileSize = Math.floor(blob.size / 1024);
|
|
28299
|
+
if (fileSize > 1000) {
|
|
28300
|
+
var megabytes = fileSize / 1024;
|
|
28301
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
28302
|
+
fileSize = +megabytes.toFixed(2);
|
|
28303
|
+
}
|
|
28304
|
+
else {
|
|
28305
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize.toFixed(2) + ' KB';
|
|
28306
|
+
fileSize = +fileSize.toFixed(2);
|
|
28307
|
+
}
|
|
28308
|
+
this.fileSize = fileSize;
|
|
28309
|
+
}).bind(this), 'image/png', 1);
|
|
28310
|
+
}
|
|
28311
|
+
}
|
|
28312
|
+
else if (!isNullOrUndefined(fileType) && fileType.toLowerCase() === 'svg') {
|
|
28313
|
+
if (Browser.isDevice) {
|
|
28314
|
+
canvas.style.display = 'none';
|
|
28315
|
+
}
|
|
28316
|
+
else {
|
|
28317
|
+
ctx.drawImage(tempCanvas, 0, 0);
|
|
28318
|
+
var svgDataUrl = tempCanvas.toDataURL('image/svg+xml');
|
|
28319
|
+
var base64Data = svgDataUrl.split(',')[1];
|
|
28320
|
+
var binaryStringLength = base64Data.length;
|
|
28321
|
+
var rawByteSize = binaryStringLength;
|
|
28322
|
+
var fileSize_1 = Math.floor(rawByteSize / 1024); // KB
|
|
28323
|
+
if (fileSize_1 > 1000) {
|
|
28324
|
+
var megabytes = fileSize_1 / 1024; // Convert to MB
|
|
28325
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
28326
|
+
fileSize_1 = +megabytes.toFixed(2);
|
|
28327
|
+
}
|
|
28328
|
+
else {
|
|
28329
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize_1.toFixed(2) + ' KB';
|
|
28330
|
+
fileSize_1 = +fileSize_1.toFixed(2);
|
|
28331
|
+
}
|
|
28332
|
+
}
|
|
28333
|
+
this.fileSize = fileSize;
|
|
28334
|
+
}
|
|
28276
28335
|
else {
|
|
28277
28336
|
if (Browser.isDevice) {
|
|
28278
28337
|
canvas.style.display = 'none';
|