@syncfusion/ej2-image-editor 27.1.48 → 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 +144 -19
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +143 -18
- 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 -13
- package/src/image-editor/action/draw.js +32 -8
- package/src/image-editor/action/selection.d.ts +3 -0
- package/src/image-editor/action/selection.js +38 -1
- package/src/image-editor/action/shape.js +4 -0
- package/src/image-editor/action/undo-redo.js +10 -0
- package/src/image-editor/base/image-editor.js +6 -4
- package/src/image-editor/renderer/toolbar.js +53 -5
|
@@ -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')) {
|
|
@@ -3463,11 +3465,19 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
3463
3465
|
parent.notify('filter', { prop: 'update-finetunes', onPropertyChange: false });
|
|
3464
3466
|
}
|
|
3465
3467
|
proxy.lowerContext.drawImage(parent.baseImg, 0, 0, proxy.parent.lowerCanvas.width, proxy.parent.lowerCanvas.height);
|
|
3468
|
+
var isCropped = false;
|
|
3469
|
+
var isSameDimension = false;
|
|
3470
|
+
if (parent.isImageUpdated) {
|
|
3471
|
+
var _a = parent.img, srcWidth = _a.srcWidth, srcHeight = _a.srcHeight;
|
|
3472
|
+
var _b = parent.baseImgCanvas, width = _b.width, height = _b.height;
|
|
3473
|
+
isCropped = srcWidth !== width || srcHeight !== height;
|
|
3474
|
+
isSameDimension = parent.baseImg.width === width && parent.baseImg.height === height;
|
|
3475
|
+
}
|
|
3466
3476
|
hideSpinner(parent.element);
|
|
3467
3477
|
parent.element.style.opacity = '1';
|
|
3468
3478
|
proxy.updateBaseImgCanvas();
|
|
3469
3479
|
var fileOpened = { fileName: _this.fileName, fileType: _this.fileType, isValidImage: true };
|
|
3470
|
-
proxy.updateCanvas();
|
|
3480
|
+
proxy.updateCanvas(isCropped, isSameDimension);
|
|
3471
3481
|
if (parent.currObjType.isUndoZoom) {
|
|
3472
3482
|
parent.currObjType.isUndoZoom = false;
|
|
3473
3483
|
proxy.parent.lowerCanvas.style.display = 'block';
|
|
@@ -3509,12 +3519,26 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
3509
3519
|
parent.baseImgCanvas.height = parent.baseImg.height;
|
|
3510
3520
|
parent.baseImgCanvas.getContext('2d').drawImage(parent.baseImg, 0, 0);
|
|
3511
3521
|
};
|
|
3512
|
-
Draw.prototype.updateCanvas = function () {
|
|
3522
|
+
Draw.prototype.updateCanvas = function (isCropped, isSameDimension) {
|
|
3513
3523
|
var parent = this.parent;
|
|
3514
|
-
if (!parent.isImageUpdated) {
|
|
3524
|
+
if (!parent.isImageUpdated || !isCropped) {
|
|
3515
3525
|
parent.img.srcWidth = parent.baseImgCanvas.width;
|
|
3516
3526
|
parent.img.srcHeight = parent.baseImgCanvas.height;
|
|
3517
3527
|
}
|
|
3528
|
+
else if (!isSameDimension && isCropped) {
|
|
3529
|
+
parent.img.srcLeft = 0;
|
|
3530
|
+
parent.img.srcTop = 0;
|
|
3531
|
+
parent.img.srcWidth = parent.baseImgCanvas.width;
|
|
3532
|
+
parent.img.srcHeight = parent.baseImgCanvas.height;
|
|
3533
|
+
parent.currSelectionPoint = null;
|
|
3534
|
+
parent.cropObj = { cropZoom: 0, defaultZoom: 0, totalPannedPoint: { x: 0, y: 0 }, totalPannedClientPoint: { x: 0, y: 0 },
|
|
3535
|
+
totalPannedInternalPoint: { x: 0, y: 0 }, tempFlipPanPoint: { x: 0, y: 0 }, activeObj: {}, rotateFlipColl: [],
|
|
3536
|
+
degree: 0, currFlipState: '', straighten: 0, destPoints: { startX: 0, startY: 0, width: 0, height: 0 },
|
|
3537
|
+
srcPoints: { startX: 0, startY: 0, width: 0, height: 0 }, filter: '', isBrightAdjust: false,
|
|
3538
|
+
zoomFactor: 0, previousZoomValue: 0, aspectWidth: null, aspectHeight: null, frame: 'none', straightenZoom: 0,
|
|
3539
|
+
adjustmentLevel: { brightness: 0, contrast: 0, hue: 0, opacity: 100, saturation: 0, blur: 0,
|
|
3540
|
+
exposure: 0, transparency: 100, sharpen: false, bw: false }, currentFilter: '' };
|
|
3541
|
+
}
|
|
3518
3542
|
var obj = { width: 0, height: 0 };
|
|
3519
3543
|
parent.notify('transform', { prop: 'calcMaxDimension', onPropertyChange: false,
|
|
3520
3544
|
value: { width: parent.img.srcWidth, height: parent.img.srcHeight, obj: obj, isImgShape: null } });
|
|
@@ -8818,6 +8842,9 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8818
8842
|
this.isSliderActive = false;
|
|
8819
8843
|
this.arrowShape = [ArrowheadType.None, ArrowheadType.SolidArrow];
|
|
8820
8844
|
this.isTouchDblClick = false;
|
|
8845
|
+
this.isMouseDown = false;
|
|
8846
|
+
this.isMouseUp = false;
|
|
8847
|
+
this.mouseWheel = 0;
|
|
8821
8848
|
this.parent = parent;
|
|
8822
8849
|
this.addEventListener();
|
|
8823
8850
|
}
|
|
@@ -9128,6 +9155,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9128
9155
|
this.isPreventDragging = false;
|
|
9129
9156
|
this.timer = undefined;
|
|
9130
9157
|
this.tempObjColl = undefined;
|
|
9158
|
+
this.mouseWheel = 0;
|
|
9131
9159
|
this.textRow = 1;
|
|
9132
9160
|
this.mouseDownPoint = { x: 0, y: 0 };
|
|
9133
9161
|
this.previousPoint = { x: 0, y: 0 };
|
|
@@ -9148,6 +9176,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9148
9176
|
this.mouseDown = '';
|
|
9149
9177
|
this.isSliderActive = false;
|
|
9150
9178
|
this.arrowShape = [ArrowheadType.None, ArrowheadType.SolidArrow];
|
|
9179
|
+
this.isMouseDown = this.isMouseUp = false;
|
|
9151
9180
|
};
|
|
9152
9181
|
Selection.prototype.performTabAction = function () {
|
|
9153
9182
|
var parent = this.parent;
|
|
@@ -10147,6 +10176,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10147
10176
|
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false, value: { shapeSettings: shapeResizingArgs.currentShapeSettings, allowShapeOverflow: shapeResizingArgs.allowShapeOverflow } });
|
|
10148
10177
|
}
|
|
10149
10178
|
else {
|
|
10179
|
+
if (this.isMouseDown) {
|
|
10180
|
+
shapeResizingArgs.action = 'resize-start';
|
|
10181
|
+
}
|
|
10182
|
+
else if (this.isMouseUp) {
|
|
10183
|
+
shapeResizingArgs.action = 'resize-end';
|
|
10184
|
+
}
|
|
10150
10185
|
var selectionResizingArgs = { action: shapeResizingArgs.action,
|
|
10151
10186
|
previousSelectionSettings: { type: parent.getSelectionType(parent.activeObj.shape),
|
|
10152
10187
|
startX: shapeResizingArgs.previousShapeSettings.startX,
|
|
@@ -11940,6 +11975,8 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11940
11975
|
}
|
|
11941
11976
|
var imageEditorClickEventArgs = { point: this.setXYPoints(e) };
|
|
11942
11977
|
parent.trigger('click', imageEditorClickEventArgs);
|
|
11978
|
+
this.isMouseDown = true;
|
|
11979
|
+
this.isMouseUp = false;
|
|
11943
11980
|
this.clickEvent(imageEditorClickEventArgs, e);
|
|
11944
11981
|
};
|
|
11945
11982
|
Selection.prototype.getImagePoints = function (x, y) {
|
|
@@ -12301,6 +12338,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12301
12338
|
}
|
|
12302
12339
|
}
|
|
12303
12340
|
if (type !== '') {
|
|
12341
|
+
parent.isZoomBtnClick = true;
|
|
12304
12342
|
parent.notify('draw', { prop: 'performPointZoom', onPropertyChange: false,
|
|
12305
12343
|
value: { x: center.x, y: center.y, type: type, isResize: null } });
|
|
12306
12344
|
}
|
|
@@ -12383,11 +12421,14 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12383
12421
|
this.dragCanvas = parent.togglePan = true;
|
|
12384
12422
|
}
|
|
12385
12423
|
}
|
|
12424
|
+
this.isMouseDown = false;
|
|
12425
|
+
this.isMouseUp = false;
|
|
12386
12426
|
};
|
|
12387
12427
|
Selection.prototype.mouseUpEventHandler = function (e) {
|
|
12388
12428
|
var parent = this.parent;
|
|
12389
12429
|
var id = parent.element.id;
|
|
12390
|
-
parent.isKBDNavigation = false;
|
|
12430
|
+
parent.isKBDNavigation = this.isMouseDown = false;
|
|
12431
|
+
this.isMouseUp = true;
|
|
12391
12432
|
if (!Browser.isDevice && ((parent.element.querySelector('#' + id + '_contextualToolbar') &&
|
|
12392
12433
|
!parent.element.querySelector('#' + id + '_contextualToolbar').parentElement.classList.contains('e-hide')) ||
|
|
12393
12434
|
(parent.element.querySelector('#' + id + '_headWrapper')
|
|
@@ -12557,6 +12598,11 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12557
12598
|
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
12558
12599
|
}
|
|
12559
12600
|
}
|
|
12601
|
+
else if (isCropSelection && this.isMouseUp && parent.cursor.indexOf('resize') > -1) {
|
|
12602
|
+
var previousShapeSettings = this.updatePrevShapeSettings();
|
|
12603
|
+
var shapeResizingArgs = { cancel: false, action: 'resize-end', previousShapeSettings: previousShapeSettings };
|
|
12604
|
+
this.triggerShapeChange(shapeResizingArgs, shapeResizingArgs, 'resize');
|
|
12605
|
+
}
|
|
12560
12606
|
if (parent.activeObj) {
|
|
12561
12607
|
var isCropSelection_1 = false;
|
|
12562
12608
|
var splitWords_1;
|
|
@@ -12676,6 +12722,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12676
12722
|
parent.isShapeDrawing = false;
|
|
12677
12723
|
parent.notify('freehand-draw', { prop: 'resetSelPoints', onPropertyChange: false });
|
|
12678
12724
|
}
|
|
12725
|
+
this.isMouseUp = false;
|
|
12679
12726
|
};
|
|
12680
12727
|
Selection.prototype.adjustActObjForLineArrow = function (obj) {
|
|
12681
12728
|
var isAdjusted = false;
|
|
@@ -13131,6 +13178,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13131
13178
|
case (e.ctrlKey && '+'):
|
|
13132
13179
|
if ((parent.zoomSettings.zoomTrigger & ZoomTrigger.Commands) === ZoomTrigger.Commands) {
|
|
13133
13180
|
this.zoomType = 'Commands';
|
|
13181
|
+
parent.isZoomBtnClick = true;
|
|
13134
13182
|
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
13135
13183
|
value: { zoomFactor: .1, zoomPoint: null }, isResize: null });
|
|
13136
13184
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
@@ -13147,6 +13195,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13147
13195
|
case (e.ctrlKey && '-'):
|
|
13148
13196
|
if ((parent.zoomSettings.zoomTrigger & ZoomTrigger.Commands) === ZoomTrigger.Commands) {
|
|
13149
13197
|
this.zoomType = 'Commands';
|
|
13198
|
+
parent.isZoomBtnClick = true;
|
|
13150
13199
|
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
13151
13200
|
value: { zoomFactor: -.1, zoomPoint: null }, isResize: null });
|
|
13152
13201
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
@@ -13283,6 +13332,11 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13283
13332
|
e.stopImmediatePropagation();
|
|
13284
13333
|
};
|
|
13285
13334
|
Selection.prototype.handleScroll = function (e) {
|
|
13335
|
+
this.mouseWheel++;
|
|
13336
|
+
if (this.mouseWheel === 2) {
|
|
13337
|
+
this.mouseWheel = 0;
|
|
13338
|
+
return;
|
|
13339
|
+
}
|
|
13286
13340
|
var parent = this.parent;
|
|
13287
13341
|
var x;
|
|
13288
13342
|
var y;
|
|
@@ -13318,6 +13372,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13318
13372
|
}
|
|
13319
13373
|
}
|
|
13320
13374
|
if (type !== '') {
|
|
13375
|
+
parent.isZoomBtnClick = true;
|
|
13321
13376
|
parent.notify('draw', { prop: 'performPointZoom', onPropertyChange: false,
|
|
13322
13377
|
value: { x: x, y: y, type: type, isResize: null } });
|
|
13323
13378
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
@@ -13682,6 +13737,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13682
13737
|
parent.editCompleteArgs = shapeChangingArgs;
|
|
13683
13738
|
}
|
|
13684
13739
|
else {
|
|
13740
|
+
if (this.isMouseDown) {
|
|
13741
|
+
shapeChangingArgs.action = 'resize-start';
|
|
13742
|
+
}
|
|
13743
|
+
else if (this.isMouseUp) {
|
|
13744
|
+
shapeChangingArgs.action = 'resize-end';
|
|
13745
|
+
}
|
|
13685
13746
|
var selectionChangingArgs = { action: shapeChangingArgs.action,
|
|
13686
13747
|
previousSelectionSettings: { type: parent.getSelectionType(parent.activeObj.shape),
|
|
13687
13748
|
startX: shapeChangingArgs.previousShapeSettings.startX,
|
|
@@ -14703,6 +14764,10 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
14703
14764
|
parent.activeObj.opacity = opacity;
|
|
14704
14765
|
}
|
|
14705
14766
|
strokeSettings.strokeWidth = strokeWidth ? strokeWidth : strokeSettings.strokeWidth;
|
|
14767
|
+
var shape = parent.activeObj.shape;
|
|
14768
|
+
if ((shape === 'rectangle' || shape === 'ellipse') && strokeWidth === 0) {
|
|
14769
|
+
strokeSettings.strokeWidth = 0;
|
|
14770
|
+
}
|
|
14706
14771
|
strokeSettings.strokeColor = strokeColor ? strokeColor : strokeSettings.strokeColor;
|
|
14707
14772
|
strokeSettings.fillColor = fillColor ? fillColor : strokeSettings.fillColor;
|
|
14708
14773
|
strokeSettings.radius = radius ? radius : strokeSettings.radius;
|
|
@@ -21499,12 +21564,22 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
21499
21564
|
var parent = this.parent;
|
|
21500
21565
|
for (var i = 0; i < parent.objColl.length; i++) {
|
|
21501
21566
|
var obj = parent.objColl[i];
|
|
21567
|
+
var isUpdated = false;
|
|
21502
21568
|
if (obj.shape === 'line' || obj.shape === 'arrow') {
|
|
21503
21569
|
if (obj.activePoint.width < 0) {
|
|
21504
21570
|
obj.activePoint.width = Math.abs(obj.activePoint.width);
|
|
21571
|
+
isUpdated = true;
|
|
21505
21572
|
}
|
|
21506
21573
|
if (obj.activePoint.height < 0) {
|
|
21507
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;
|
|
21508
21583
|
}
|
|
21509
21584
|
}
|
|
21510
21585
|
}
|
|
@@ -22292,6 +22367,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
22292
22367
|
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: browseObj } });
|
|
22293
22368
|
var supportObj = { key: 'SupportText' };
|
|
22294
22369
|
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
|
|
22370
|
+
var andObj = { key: 'And' };
|
|
22371
|
+
this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: andObj } });
|
|
22295
22372
|
var dropAreaElement = this.createElement('div', { id: this.element.id + '_dropArea', className: 'e-ie-drop-area', attrs: { style: 'position: relative;' } });
|
|
22296
22373
|
var dropIconElement = this.createElement('span', { className: 'e-ie-drop-icon e-icons e-image', attrs: { style: 'position: absolute;' } });
|
|
22297
22374
|
var dropContentElement = this.createElement('span', { className: 'e-ie-drop-content', attrs: { style: 'position: absolute; display: none;' } });
|
|
@@ -22307,7 +22384,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
22307
22384
|
dropAnchorElement.href = '';
|
|
22308
22385
|
minDropAnchorElem.href = '';
|
|
22309
22386
|
var dropInfoElement = this.createElement('span', { className: 'e-ie-drop-info', attrs: { position: 'absolute' } });
|
|
22310
|
-
dropInfoElement.textContent = supportObj['value'] + ' SVG, PNG,
|
|
22387
|
+
dropInfoElement.textContent = supportObj['value'] + ' SVG, PNG, ' + andObj['value'] + ' JPG';
|
|
22311
22388
|
var dropUploader = dropAreaElement.appendChild(this.createElement('input', {
|
|
22312
22389
|
id: this.element.id + '_dropfileUpload', className: 'e-fileUpload e-image-upload'
|
|
22313
22390
|
}));
|
|
@@ -22551,7 +22628,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
22551
22628
|
this.notify('draw', { prop: 'open', value: { data: data } });
|
|
22552
22629
|
}
|
|
22553
22630
|
else {
|
|
22554
|
-
this.updateImage(data, imageSettings.backgroundColor);
|
|
22631
|
+
this.updateImage(data, imageSettings ? imageSettings.backgroundColor : null);
|
|
22555
22632
|
}
|
|
22556
22633
|
};
|
|
22557
22634
|
/**
|
|
@@ -23777,7 +23854,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
23777
23854
|
};
|
|
23778
23855
|
ImageEditor.prototype.updateImage = function (data, imageBackgroundColor) {
|
|
23779
23856
|
var _this = this;
|
|
23780
|
-
if (data || imageBackgroundColor) {
|
|
23857
|
+
if (data || imageBackgroundColor || imageBackgroundColor === '') {
|
|
23781
23858
|
var prevCropObj_1 = extend({}, this.cropObj, {}, true);
|
|
23782
23859
|
var object = { currObj: {} };
|
|
23783
23860
|
this.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
|
|
@@ -23819,7 +23896,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
23819
23896
|
}
|
|
23820
23897
|
}, 100);
|
|
23821
23898
|
}
|
|
23822
|
-
if (imageBackgroundColor) {
|
|
23899
|
+
if (imageBackgroundColor || imageBackgroundColor === '') {
|
|
23823
23900
|
this.notify('draw', { prop: 'imageBackgroundColor', onPropertyChange: false, value: { color: imageBackgroundColor } });
|
|
23824
23901
|
this.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
|
|
23825
23902
|
if (!data) {
|
|
@@ -26528,7 +26605,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26528
26605
|
BorderRadius: 'Border Radius',
|
|
26529
26606
|
TextOutlineColor: 'Outline Color',
|
|
26530
26607
|
TextOutlineWidth: 'Outline Width',
|
|
26531
|
-
PixelSize: 'Pixel Size'
|
|
26608
|
+
PixelSize: 'Pixel Size',
|
|
26609
|
+
And: 'and'
|
|
26532
26610
|
};
|
|
26533
26611
|
this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
|
|
26534
26612
|
};
|
|
@@ -27196,13 +27274,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27196
27274
|
zoomIn.addEventListener('mousedown', this.zoomInBtnMouseDownHandler.bind(this));
|
|
27197
27275
|
zoomIn.addEventListener('mouseup', this.zoomBtnMouseUpHandler.bind(this));
|
|
27198
27276
|
zoomIn.addEventListener('click', this.zoomInBtnClickHandler.bind(this));
|
|
27199
|
-
zoomIn.addEventListener('touchstart', this.zoomInBtnClickHandler.bind(this));
|
|
27200
27277
|
}
|
|
27201
27278
|
if (zoomOut) {
|
|
27202
27279
|
zoomOut.addEventListener('mousedown', this.zoomOutBtnMouseDownHandler.bind(this));
|
|
27203
27280
|
zoomOut.addEventListener('mouseup', this.zoomBtnMouseUpHandler.bind(this));
|
|
27204
27281
|
zoomOut.addEventListener('click', this.zoomOutBtnClickHandler.bind(this));
|
|
27205
|
-
zoomIn.addEventListener('touchstart', this.zoomInBtnClickHandler.bind(this));
|
|
27206
27282
|
}
|
|
27207
27283
|
};
|
|
27208
27284
|
ToolbarModule.prototype.widthPress = function (e) {
|
|
@@ -27718,6 +27794,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27718
27794
|
zOrderElement.classList.remove('e-overlay');
|
|
27719
27795
|
}
|
|
27720
27796
|
}
|
|
27797
|
+
if (zOrderElement && (parent.shapeColl.length === 0 || (obj['freehandDrawSelectedId'] && parent.shapeColl.length === 1))) {
|
|
27798
|
+
zOrderElement.classList.add('e-overlay');
|
|
27799
|
+
}
|
|
27721
27800
|
};
|
|
27722
27801
|
ToolbarModule.prototype.renderStraightenSlider = function () {
|
|
27723
27802
|
var parent = this.parent;
|
|
@@ -28187,11 +28266,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
28187
28266
|
fileSize = Math.floor(blob.size / 1024);
|
|
28188
28267
|
if (fileSize > 1000) {
|
|
28189
28268
|
var megabytes = fileSize / 1024;
|
|
28190
|
-
imageNameLabel.innerHTML = '
|
|
28269
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + megabytes.toFixed(2) + ' MB';
|
|
28191
28270
|
fileSize = +megabytes.toFixed(2);
|
|
28192
28271
|
}
|
|
28193
28272
|
else {
|
|
28194
|
-
imageNameLabel.innerHTML = '
|
|
28273
|
+
imageNameLabel.innerHTML = this.l10n.getConstant('ImageSize') + ': ' + fileSize.toFixed(2) + ' KB';
|
|
28195
28274
|
fileSize = +fileSize.toFixed(2);
|
|
28196
28275
|
}
|
|
28197
28276
|
if (Browser.isDevice) {
|
|
@@ -28209,6 +28288,50 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
28209
28288
|
this.fileSize = fileSize;
|
|
28210
28289
|
}).bind(this), 'image/jpeg', quality);
|
|
28211
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
|
+
}
|
|
28212
28335
|
else {
|
|
28213
28336
|
if (Browser.isDevice) {
|
|
28214
28337
|
canvas.style.display = 'none';
|
|
@@ -31754,6 +31877,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
31754
31877
|
parent.notify('draw', { prop: 'render-image', value: { isMouseWheel: null, isPreventClearRect: null, isFrame: true } });
|
|
31755
31878
|
parent.isFrameBtnClick = true;
|
|
31756
31879
|
parent.curFrameObjEvent = { previousFrameSetting: parent.tempFrameObj, currentFrameSetting: parent.frameObj };
|
|
31880
|
+
parent.notify('draw', { prop: 'triggerFrameChange', value: { prevFrameSettings: parent.tempFrameObj, obj: { frameChangeEventArgs: null } } });
|
|
31757
31881
|
break;
|
|
31758
31882
|
case 'redact':
|
|
31759
31883
|
parent.currObjType.isRedact = true;
|
|
@@ -31880,6 +32004,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
31880
32004
|
parent.img.destTop += (parent.cxtTbarHeight / 2);
|
|
31881
32005
|
}
|
|
31882
32006
|
this.callFrameToolbar();
|
|
32007
|
+
parent.notify('draw', { prop: 'triggerFrameChange', value: { prevFrameSettings: parent.frameObj, obj: { frameChangeEventArgs: null } } });
|
|
31883
32008
|
}
|
|
31884
32009
|
};
|
|
31885
32010
|
ToolbarModule.prototype.zoomToFrameRange = function () {
|