@syncfusion/ej2-image-editor 24.2.4 → 24.2.8
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 +20 -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 +328 -242
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +328 -243
- 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/draw.js +2 -1
- package/src/image-editor/action/selection.d.ts +2 -0
- package/src/image-editor/action/selection.js +256 -235
- package/src/image-editor/action/shape.js +56 -1
- package/src/image-editor/base/image-editor.js +12 -6
- package/src/image-editor/base/interface.d.ts +26 -2
- package/src/image-editor/renderer/toolbar.js +2 -0
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -63
- package/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -39
|
@@ -4761,7 +4761,8 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
4761
4761
|
if (!isBlazor()) {
|
|
4762
4762
|
parent.notify('toolbar', { prop: 'getDefToolbarItems', value: { obj: obj } });
|
|
4763
4763
|
if (obj['defToolbarItems'].length === 0 &&
|
|
4764
|
-
(isNullOrUndefined(document.getElementById(id + '_toolbar')))
|
|
4764
|
+
(isNullOrUndefined(document.getElementById(id + '_toolbar'))) &&
|
|
4765
|
+
parent.element.querySelector('#' + id + '_toolbarArea')) {
|
|
4765
4766
|
var height = parent.element.querySelector('#' + id + '_toolbarArea').clientHeight;
|
|
4766
4767
|
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: height } });
|
|
4767
4768
|
}
|
|
@@ -8322,6 +8323,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8322
8323
|
this.isPinching = false;
|
|
8323
8324
|
this.isSliding = false;
|
|
8324
8325
|
this.mouseDown = '';
|
|
8326
|
+
this.isSliderActive = false;
|
|
8325
8327
|
this.parent = parent;
|
|
8326
8328
|
this.addEventListener();
|
|
8327
8329
|
}
|
|
@@ -8564,6 +8566,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8564
8566
|
case 'setSliding':
|
|
8565
8567
|
this.isSliding = args.value['bool'];
|
|
8566
8568
|
break;
|
|
8569
|
+
case 'setSliderActive':
|
|
8570
|
+
this.isSliderActive = args.value['bool'];
|
|
8571
|
+
break;
|
|
8572
|
+
case 'getArrowType':
|
|
8573
|
+
args.value['obj']['type'] = this.getArrowType(args.value['type']);
|
|
8574
|
+
break;
|
|
8567
8575
|
}
|
|
8568
8576
|
};
|
|
8569
8577
|
Selection.prototype.getModuleName = function () {
|
|
@@ -8611,6 +8619,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8611
8619
|
this.initialPrevObj = {};
|
|
8612
8620
|
this.resizedElement = '';
|
|
8613
8621
|
this.mouseDown = '';
|
|
8622
|
+
this.isSliderActive = false;
|
|
8614
8623
|
};
|
|
8615
8624
|
Selection.prototype.performTabAction = function () {
|
|
8616
8625
|
var parent = this.parent;
|
|
@@ -11468,272 +11477,273 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11468
11477
|
&& !parent.element.querySelector('#' + id + '_headWrapper').parentElement.classList.contains('e-hide')))) {
|
|
11469
11478
|
return;
|
|
11470
11479
|
}
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
this.isTouch = false;
|
|
11477
|
-
}
|
|
11478
|
-
else if (e.type === 'touchend') {
|
|
11479
|
-
e.stopImmediatePropagation();
|
|
11480
|
-
}
|
|
11481
|
-
e.preventDefault();
|
|
11482
|
-
if (parent.togglePan) {
|
|
11483
|
-
this.canvasMouseUpHandler(e);
|
|
11484
|
-
}
|
|
11485
|
-
var x;
|
|
11486
|
-
var y;
|
|
11487
|
-
if (e.type === 'mouseup') {
|
|
11488
|
-
x = e.clientX;
|
|
11489
|
-
y = e.clientY;
|
|
11490
|
-
}
|
|
11491
|
-
else {
|
|
11492
|
-
x = this.touchEndPoint.x;
|
|
11493
|
-
y = this.touchEndPoint.y;
|
|
11494
|
-
}
|
|
11495
|
-
var bbox = parent.lowerCanvas.getBoundingClientRect();
|
|
11496
|
-
x -= bbox.left;
|
|
11497
|
-
y -= bbox.top;
|
|
11498
|
-
if (e.type === 'touchend') {
|
|
11499
|
-
this.startTouches = this.tempTouches = [];
|
|
11500
|
-
this.isFirstMove = false;
|
|
11501
|
-
if (parent.textArea.style.display === 'none') {
|
|
11502
|
-
this.timer = 0;
|
|
11480
|
+
if (this.mouseDown === 'canvas' || this.isSliderActive ||
|
|
11481
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11482
|
+
e.target.closest('.e-image-editor') || e.target.closest('.e-ie-ddb-popup')) {
|
|
11483
|
+
if (e.type === 'touchstart') {
|
|
11484
|
+
this.isTouch = false;
|
|
11503
11485
|
}
|
|
11504
|
-
if (
|
|
11505
|
-
|
|
11506
|
-
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
11507
|
-
if (parent.isCropTab || parent.activeObj.shape) {
|
|
11508
|
-
parent.notify('draw', { prop: 'setStraightenActObj', value: { activeObj: null } });
|
|
11509
|
-
parent.notify('freehand-draw', { prop: 'resetStraightenPoint' });
|
|
11510
|
-
}
|
|
11511
|
-
if (parent.isStraightening) {
|
|
11512
|
-
parent.notify('draw', { prop: 'resetStraightenDestPoints' });
|
|
11513
|
-
parent.notify('draw', { prop: 'setDestForStraighten' });
|
|
11514
|
-
}
|
|
11515
|
-
return;
|
|
11486
|
+
else if (e.type === 'touchend') {
|
|
11487
|
+
e.stopImmediatePropagation();
|
|
11516
11488
|
}
|
|
11517
|
-
|
|
11518
|
-
|
|
11519
|
-
|
|
11520
|
-
if (parent.activeObj.shape !== undefined) {
|
|
11521
|
-
splitWords = parent.activeObj.shape.split('-');
|
|
11522
|
-
}
|
|
11523
|
-
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
11524
|
-
isCropSelection = true;
|
|
11525
|
-
}
|
|
11526
|
-
if (isBlazor() && parent.eventType) {
|
|
11527
|
-
if (parent.eventType === 'pan') {
|
|
11528
|
-
if (parent.events && parent.events.onPanEnd.hasDelegate === true) {
|
|
11529
|
-
parent.dotNetRef.invokeMethodAsync('PanEventAsync', 'OnPanEnd', parent.panEventArgs);
|
|
11530
|
-
}
|
|
11489
|
+
e.preventDefault();
|
|
11490
|
+
if (parent.togglePan) {
|
|
11491
|
+
this.canvasMouseUpHandler(e);
|
|
11531
11492
|
}
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShapeResizeEnd', this.shapeResizingArgs, null).then(function (shapeResizingArgs) {
|
|
11538
|
-
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
|
|
11539
|
-
value: { shapeSettings: shapeResizingArgs.currentShapeSettings } });
|
|
11540
|
-
});
|
|
11541
|
-
}
|
|
11542
|
-
else if (this.shapeResizingArgs && this.selectionResizingArgs && parent.events &&
|
|
11543
|
-
parent.events.onSelectionResizeEnd.hasDelegate === true) {
|
|
11544
|
-
var currentSelectionSettings = { type: parent.activeObj.shape,
|
|
11545
|
-
startX: this.shapeResizingArgs.currentShapeSettings.startX,
|
|
11546
|
-
startY: this.shapeResizingArgs.currentShapeSettings.startY,
|
|
11547
|
-
width: this.shapeResizingArgs.currentShapeSettings.width,
|
|
11548
|
-
height: this.shapeResizingArgs.currentShapeSettings.height };
|
|
11549
|
-
this.selectionResizingArgs.currentSelectionSettings = currentSelectionSettings;
|
|
11550
|
-
this.selectionResizingArgs.action = 'resize-end';
|
|
11551
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11552
|
-
parent.dotNetRef.invokeMethodAsync('SelectionEventAsync', 'OnSelectionResizeEnd', this.selectionResizingArgs).then(function (selectionResizingArgs) {
|
|
11553
|
-
parent.notify('shape', { prop: 'updateSelectionChangeEventArgs', onPropertyChange: false,
|
|
11554
|
-
value: { selectionSettings: selectionResizingArgs.currentSelectionSettings } });
|
|
11555
|
-
});
|
|
11556
|
-
}
|
|
11493
|
+
var x = void 0;
|
|
11494
|
+
var y = void 0;
|
|
11495
|
+
if (e.type === 'mouseup') {
|
|
11496
|
+
x = e.clientX;
|
|
11497
|
+
y = e.clientY;
|
|
11557
11498
|
}
|
|
11558
11499
|
else {
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11566
|
-
|
|
11500
|
+
x = this.touchEndPoint.x;
|
|
11501
|
+
y = this.touchEndPoint.y;
|
|
11502
|
+
}
|
|
11503
|
+
var bbox = parent.lowerCanvas.getBoundingClientRect();
|
|
11504
|
+
x -= bbox.left;
|
|
11505
|
+
y -= bbox.top;
|
|
11506
|
+
if (e.type === 'touchend') {
|
|
11507
|
+
this.startTouches = this.tempTouches = [];
|
|
11508
|
+
this.isFirstMove = false;
|
|
11509
|
+
if (parent.textArea.style.display === 'none') {
|
|
11510
|
+
this.timer = 0;
|
|
11511
|
+
}
|
|
11512
|
+
if (this.isPinching) {
|
|
11513
|
+
this.isPinching = false;
|
|
11514
|
+
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
11515
|
+
if (parent.isCropTab || parent.activeObj.shape) {
|
|
11516
|
+
parent.notify('draw', { prop: 'setStraightenActObj', value: { activeObj: null } });
|
|
11517
|
+
parent.notify('freehand-draw', { prop: 'resetStraightenPoint' });
|
|
11518
|
+
}
|
|
11519
|
+
if (parent.isStraightening) {
|
|
11520
|
+
parent.notify('draw', { prop: 'resetStraightenDestPoints' });
|
|
11521
|
+
parent.notify('draw', { prop: 'setDestForStraighten' });
|
|
11522
|
+
}
|
|
11523
|
+
return;
|
|
11567
11524
|
}
|
|
11568
11525
|
}
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
parent.
|
|
11572
|
-
|
|
11573
|
-
}
|
|
11574
|
-
if (this.currentDrawingShape === 'path') {
|
|
11575
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11576
|
-
var elem = e.srcElement;
|
|
11577
|
-
var elemId = elem.parentElement.id;
|
|
11578
|
-
var id_1 = parent.element.id;
|
|
11579
|
-
if (e.currentTarget !== parent.upperCanvas && e.currentTarget !== parent.lowerCanvas && parent.activeObj.pointColl.length > 0 &&
|
|
11580
|
-
(elem.classList.contains('e-upload-icon') || elemId === id_1 + '_zoomIn' ||
|
|
11581
|
-
elemId === id_1 + '_zoomOut' || elemId === id_1 + '_annotationBtn' ||
|
|
11582
|
-
elemId === id_1 + '_borderColorBtn' || elemId === id_1 + '_borderWidthBtn' || elemId === id_1 + '_saveBtn')) {
|
|
11583
|
-
parent.notify('shape', { prop: 'stopPathDrawing', onPropertyChange: false, value: { e: e, isApply: true } });
|
|
11584
|
-
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
11585
|
-
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj, isCropRatio: null,
|
|
11586
|
-
points: null, isPreventDrag: true, saveContext: null, isPreventSelection: true } });
|
|
11526
|
+
var isCropSelection = false;
|
|
11527
|
+
var splitWords = void 0;
|
|
11528
|
+
if (parent.activeObj.shape !== undefined) {
|
|
11529
|
+
splitWords = parent.activeObj.shape.split('-');
|
|
11587
11530
|
}
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11593
|
-
|
|
11594
|
-
|
|
11595
|
-
|
|
11596
|
-
value: { operation: 'shapeInsert', previousObj: this.initialPrevObj, previousObjColl: this.initialPrevObj.objColl,
|
|
11597
|
-
previousPointColl: this.initialPrevObj.pointColl, previousSelPointColl: this.initialPrevObj.selPointColl,
|
|
11598
|
-
previousCropObj: prevCropObj_1, previousText: null,
|
|
11599
|
-
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
11531
|
+
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
11532
|
+
isCropSelection = true;
|
|
11533
|
+
}
|
|
11534
|
+
if (isBlazor() && parent.eventType) {
|
|
11535
|
+
if (parent.eventType === 'pan') {
|
|
11536
|
+
if (parent.events && parent.events.onPanEnd.hasDelegate === true) {
|
|
11537
|
+
parent.dotNetRef.invokeMethodAsync('PanEventAsync', 'OnPanEnd', parent.panEventArgs);
|
|
11538
|
+
}
|
|
11600
11539
|
}
|
|
11601
|
-
else {
|
|
11602
|
-
|
|
11603
|
-
|
|
11604
|
-
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
prevObj.afterCropActions = extend([], parent.afterCropActions, [], true);
|
|
11626
|
-
var selPointCollObj = { selPointColl: null };
|
|
11627
|
-
parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
11628
|
-
value: { obj: selPointCollObj } });
|
|
11629
|
-
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
11630
|
-
if (!parent.togglePen && !isCropSelection) {
|
|
11631
|
-
if (this.tempObjColl && parent.activeObj.activePoint.width !== 0) {
|
|
11632
|
-
parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
|
|
11633
|
-
parent.objColl.push(parent.activeObj);
|
|
11634
|
-
if (JSON.stringify(parent.activeObj.activePoint) !== JSON.stringify(this.tempActiveObj.activePoint)) {
|
|
11635
|
-
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
11636
|
-
value: { operation: 'shapeTransform', previousObj: prevObj, previousObjColl: this.tempObjColl,
|
|
11637
|
-
previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
|
|
11638
|
-
previousCropObj: prevCropObj, previousText: null,
|
|
11639
|
-
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
11540
|
+
else if (parent.eventType === 'resize') {
|
|
11541
|
+
if (!this.isCropSelection && parent.events && parent.events.onShapeResizeEnd.hasDelegate === true) {
|
|
11542
|
+
this.shapeResizingArgs.currentShapeSettings = this.updatePrevShapeSettings();
|
|
11543
|
+
this.shapeResizingArgs.action = this.currentDrawingShape !== '' ? 'drawing' : 'resize-end';
|
|
11544
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11545
|
+
parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShapeResizeEnd', this.shapeResizingArgs, null).then(function (shapeResizingArgs) {
|
|
11546
|
+
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
|
|
11547
|
+
value: { shapeSettings: shapeResizingArgs.currentShapeSettings } });
|
|
11548
|
+
});
|
|
11549
|
+
}
|
|
11550
|
+
else if (this.shapeResizingArgs && this.selectionResizingArgs && parent.events &&
|
|
11551
|
+
parent.events.onSelectionResizeEnd.hasDelegate === true) {
|
|
11552
|
+
var currentSelectionSettings = { type: parent.activeObj.shape,
|
|
11553
|
+
startX: this.shapeResizingArgs.currentShapeSettings.startX,
|
|
11554
|
+
startY: this.shapeResizingArgs.currentShapeSettings.startY,
|
|
11555
|
+
width: this.shapeResizingArgs.currentShapeSettings.width,
|
|
11556
|
+
height: this.shapeResizingArgs.currentShapeSettings.height };
|
|
11557
|
+
this.selectionResizingArgs.currentSelectionSettings = currentSelectionSettings;
|
|
11558
|
+
this.selectionResizingArgs.action = 'resize-end';
|
|
11559
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11560
|
+
parent.dotNetRef.invokeMethodAsync('SelectionEventAsync', 'OnSelectionResizeEnd', this.selectionResizingArgs).then(function (selectionResizingArgs) {
|
|
11561
|
+
parent.notify('shape', { prop: 'updateSelectionChangeEventArgs', onPropertyChange: false,
|
|
11562
|
+
value: { selectionSettings: selectionResizingArgs.currentSelectionSettings } });
|
|
11563
|
+
});
|
|
11640
11564
|
}
|
|
11641
|
-
this.redrawShape(parent.objColl[parent.objColl.length - 1], true);
|
|
11642
|
-
this.tempObjColl = undefined;
|
|
11643
11565
|
}
|
|
11644
|
-
|
|
11645
|
-
this.
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11566
|
+
else {
|
|
11567
|
+
if (this.shapeMovingArgs && parent.events && parent.events.onShapeDragEnd.hasDelegate === true) {
|
|
11568
|
+
this.shapeMovingArgs.currentShapeSettings = this.updatePrevShapeSettings();
|
|
11569
|
+
this.shapeMovingArgs.action = 'drag-end';
|
|
11570
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11571
|
+
parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShapeDragEnd', this.shapeMovingArgs, null).then(function (shapeMovingArgs) {
|
|
11572
|
+
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
|
|
11573
|
+
value: { shapeSettings: shapeMovingArgs.currentShapeSettings } });
|
|
11574
|
+
});
|
|
11649
11575
|
}
|
|
11650
11576
|
}
|
|
11577
|
+
this.shapeResizingArgs = null;
|
|
11578
|
+
this.shapeMovingArgs = null;
|
|
11579
|
+
parent.panEventArgs = null;
|
|
11580
|
+
parent.eventType = null;
|
|
11651
11581
|
}
|
|
11652
|
-
if (
|
|
11653
|
-
|
|
11654
|
-
var
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11582
|
+
if (this.currentDrawingShape === 'path') {
|
|
11583
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11584
|
+
var elem = e.srcElement;
|
|
11585
|
+
var elemId = elem.parentElement.id;
|
|
11586
|
+
var id_1 = parent.element.id;
|
|
11587
|
+
if (e.currentTarget !== parent.upperCanvas && e.currentTarget !== parent.lowerCanvas && parent.activeObj.pointColl.length > 0 &&
|
|
11588
|
+
(elem.classList.contains('e-upload-icon') || elemId === id_1 + '_zoomIn' ||
|
|
11589
|
+
elemId === id_1 + '_zoomOut' || elemId === id_1 + '_annotationBtn' ||
|
|
11590
|
+
elemId === id_1 + '_borderColorBtn' || elemId === id_1 + '_borderWidthBtn' || elemId === id_1 + '_saveBtn')) {
|
|
11591
|
+
parent.notify('shape', { prop: 'stopPathDrawing', onPropertyChange: false, value: { e: e, isApply: true } });
|
|
11592
|
+
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
11593
|
+
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj, isCropRatio: null,
|
|
11594
|
+
points: null, isPreventDrag: true, saveContext: null, isPreventSelection: true } });
|
|
11660
11595
|
}
|
|
11661
|
-
|
|
11662
|
-
|
|
11596
|
+
return;
|
|
11597
|
+
}
|
|
11598
|
+
if (e.currentTarget === parent.upperCanvas && !parent.isResize) {
|
|
11599
|
+
this.pathAdjustedIndex = null;
|
|
11600
|
+
if (this.currentDrawingShape !== '') {
|
|
11601
|
+
if (this.currentDrawingShape === 'text') {
|
|
11602
|
+
var prevCropObj_1 = extend({}, parent.cropObj, {}, true);
|
|
11603
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
11604
|
+
value: { operation: 'shapeInsert', previousObj: this.initialPrevObj, previousObjColl: this.initialPrevObj.objColl,
|
|
11605
|
+
previousPointColl: this.initialPrevObj.pointColl, previousSelPointColl: this.initialPrevObj.selPointColl,
|
|
11606
|
+
previousCropObj: prevCropObj_1, previousText: null,
|
|
11607
|
+
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
11608
|
+
}
|
|
11609
|
+
else {
|
|
11610
|
+
parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: this.initialPrevObj.objColl, operation: 'shapeInsert' } });
|
|
11611
|
+
}
|
|
11612
|
+
this.isShapeInserted = true;
|
|
11613
|
+
this.currentDrawingShape = '';
|
|
11614
|
+
if (parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) {
|
|
11615
|
+
parent.notify('draw', { prop: 'performCancel', value: { isContextualToolbar: null } });
|
|
11616
|
+
}
|
|
11617
|
+
var previousShapeSettings = this.updatePrevShapeSettings();
|
|
11618
|
+
var shapeResizingArgs = { cancel: false, action: 'draw-end', previousShapeSettings: previousShapeSettings };
|
|
11619
|
+
var shapeMovingArgs = { cancel: false, action: 'move', previousShapeSettings: previousShapeSettings };
|
|
11620
|
+
this.shapeResizingArgs = shapeResizingArgs;
|
|
11621
|
+
this.shapeMovingArgs = shapeMovingArgs;
|
|
11622
|
+
this.triggerShapeChange(shapeResizingArgs, shapeMovingArgs, 'mouse-up');
|
|
11623
|
+
}
|
|
11624
|
+
this.adjustActObjForLineArrow();
|
|
11625
|
+
this.updPtCollForShpRot();
|
|
11626
|
+
parent.currObjType.shape = parent.currObjType.shape.toLowerCase();
|
|
11627
|
+
var prevCropObj = extend({}, parent.cropObj, {}, true);
|
|
11628
|
+
var object = { currObj: {} };
|
|
11629
|
+
parent.notify('filter', { prop: 'getCurrentObj', onPropertyChange: false, value: { object: object } });
|
|
11630
|
+
var prevObj = object['currObj'];
|
|
11631
|
+
prevObj.objColl = extend([], parent.objColl, [], true);
|
|
11632
|
+
prevObj.pointColl = extend([], parent.pointColl, [], true);
|
|
11633
|
+
prevObj.afterCropActions = extend([], parent.afterCropActions, [], true);
|
|
11634
|
+
var selPointCollObj = { selPointColl: null };
|
|
11635
|
+
parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
11636
|
+
value: { obj: selPointCollObj } });
|
|
11637
|
+
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
11638
|
+
if (!parent.togglePen && !isCropSelection) {
|
|
11639
|
+
if (this.tempObjColl && parent.activeObj.activePoint.width !== 0) {
|
|
11640
|
+
parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
|
|
11641
|
+
parent.objColl.push(parent.activeObj);
|
|
11642
|
+
if (JSON.stringify(parent.activeObj.activePoint) !== JSON.stringify(this.tempActiveObj.activePoint)) {
|
|
11643
|
+
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
11644
|
+
value: { operation: 'shapeTransform', previousObj: prevObj, previousObjColl: this.tempObjColl,
|
|
11645
|
+
previousPointColl: prevObj.pointColl, previousSelPointColl: prevObj.selPointColl,
|
|
11646
|
+
previousCropObj: prevCropObj, previousText: null,
|
|
11647
|
+
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
11648
|
+
}
|
|
11649
|
+
this.redrawShape(parent.objColl[parent.objColl.length - 1], true);
|
|
11650
|
+
this.tempObjColl = undefined;
|
|
11651
|
+
}
|
|
11652
|
+
if (!this.isFhdEditing) {
|
|
11653
|
+
this.applyCurrActObj(x, y);
|
|
11654
|
+
parent.currObjType.isResize = false;
|
|
11655
|
+
if (!isBlazor()) {
|
|
11656
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
11657
|
+
}
|
|
11658
|
+
}
|
|
11663
11659
|
}
|
|
11664
|
-
|
|
11665
|
-
|
|
11666
|
-
var
|
|
11667
|
-
if (
|
|
11668
|
-
parent.
|
|
11669
|
-
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11660
|
+
if (parent.activeObj) {
|
|
11661
|
+
var isCropSelection_1 = false;
|
|
11662
|
+
var splitWords_1;
|
|
11663
|
+
if (parent.activeObj.shape !== undefined) {
|
|
11664
|
+
splitWords_1 = parent.activeObj.shape.split('-');
|
|
11670
11665
|
}
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
11666
|
+
if (splitWords_1 === undefined && (parent.currObjType.isCustomCrop || parent.togglePen)) {
|
|
11667
|
+
isCropSelection_1 = true;
|
|
11668
|
+
}
|
|
11669
|
+
else if (splitWords_1 !== undefined && splitWords_1[0] === 'crop') {
|
|
11670
|
+
isCropSelection_1 = true;
|
|
11671
|
+
}
|
|
11672
|
+
var shape = parent.activeObj.shape;
|
|
11673
|
+
if (!isBlazor()) {
|
|
11674
|
+
var shapeColl = ['rectangle', 'ellipse', 'line', 'arrow', 'path'];
|
|
11675
|
+
if (shapeColl.indexOf(shape) > -1) {
|
|
11676
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
|
|
11677
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11678
|
+
}
|
|
11679
|
+
else if (shape === 'text') {
|
|
11680
|
+
if (parent.textArea.style.display === 'none') {
|
|
11681
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
|
|
11682
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11683
|
+
}
|
|
11684
|
+
}
|
|
11685
|
+
else if (this.isFhdEditing) {
|
|
11686
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
|
|
11674
11687
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11675
11688
|
}
|
|
11689
|
+
else if (!isCropSelection_1) {
|
|
11690
|
+
var eventargs = { type: 'main', isApplyBtn: null, isCropping: false, isZooming: null };
|
|
11691
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
11692
|
+
}
|
|
11693
|
+
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
11676
11694
|
}
|
|
11677
|
-
else
|
|
11678
|
-
|
|
11679
|
-
|
|
11695
|
+
else {
|
|
11696
|
+
var shapeColl = ['rectangle', 'ellipse', 'line', 'arrow', 'path', 'image'];
|
|
11697
|
+
if (shapeColl.indexOf(shape) > -1) {
|
|
11698
|
+
parent.updateToolbar(parent.element, parent.activeObj.shape);
|
|
11699
|
+
}
|
|
11700
|
+
else if (parent.activeObj.shape === 'text' && parent.textArea.style.display === 'none') {
|
|
11701
|
+
parent.updateToolbar(parent.element, 'text');
|
|
11702
|
+
}
|
|
11680
11703
|
}
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11704
|
+
}
|
|
11705
|
+
}
|
|
11706
|
+
if (parent.activeObj.shape !== undefined) {
|
|
11707
|
+
splitWords = parent.activeObj.shape.split('-');
|
|
11708
|
+
}
|
|
11709
|
+
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
11710
|
+
isCropSelection = true;
|
|
11711
|
+
}
|
|
11712
|
+
if (parent.activeObj.shape && !isCropSelection && e.currentTarget === parent.upperCanvas &&
|
|
11713
|
+
parent.textArea.style.display === 'none') {
|
|
11714
|
+
if (parent.activeObj.shape === 'text') {
|
|
11715
|
+
if (!isBlazor()) {
|
|
11716
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
|
|
11717
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11684
11718
|
}
|
|
11685
|
-
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
11686
11719
|
}
|
|
11687
11720
|
else {
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
}
|
|
11692
|
-
else if (parent.activeObj.shape === 'text' && parent.textArea.style.display === 'none') {
|
|
11693
|
-
parent.updateToolbar(parent.element, 'text');
|
|
11721
|
+
if (!isBlazor()) {
|
|
11722
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
|
|
11723
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11694
11724
|
}
|
|
11695
11725
|
}
|
|
11696
|
-
}
|
|
11697
|
-
}
|
|
11698
|
-
if (parent.activeObj.shape !== undefined) {
|
|
11699
|
-
splitWords = parent.activeObj.shape.split('-');
|
|
11700
|
-
}
|
|
11701
|
-
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
11702
|
-
isCropSelection = true;
|
|
11703
|
-
}
|
|
11704
|
-
if (parent.activeObj.shape && !isCropSelection && e.currentTarget === parent.upperCanvas &&
|
|
11705
|
-
parent.textArea.style.display === 'none') {
|
|
11706
|
-
if (parent.activeObj.shape === 'text') {
|
|
11707
11726
|
if (!isBlazor()) {
|
|
11708
|
-
parent.notify('toolbar', { prop: '
|
|
11709
|
-
|
|
11727
|
+
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
11728
|
+
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
11710
11729
|
}
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
if (!isBlazor()) {
|
|
11714
|
-
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
|
|
11715
|
-
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11730
|
+
else {
|
|
11731
|
+
parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
|
|
11716
11732
|
}
|
|
11717
11733
|
}
|
|
11718
|
-
if (
|
|
11719
|
-
parent.notify('
|
|
11720
|
-
|
|
11734
|
+
if (parent.togglePen && e.currentTarget === parent.upperCanvas) {
|
|
11735
|
+
parent.notify('freehand-draw', { prop: 'freehandUpHandler', onPropertyChange: false,
|
|
11736
|
+
value: { e: e, canvas: parent.upperCanvas, context: this.upperContext } });
|
|
11721
11737
|
}
|
|
11722
11738
|
else {
|
|
11723
|
-
parent.
|
|
11739
|
+
parent.currObjType.shape = '';
|
|
11724
11740
|
}
|
|
11741
|
+
this.dragElement = '';
|
|
11742
|
+
this.mouseDown = '';
|
|
11743
|
+
this.isSliderActive = false;
|
|
11744
|
+
parent.currObjType.isInitialLine = parent.currObjType.isDragging = false;
|
|
11745
|
+
this.selMouseUpEvent();
|
|
11725
11746
|
}
|
|
11726
|
-
if (parent.togglePen && e.currentTarget === parent.upperCanvas) {
|
|
11727
|
-
parent.notify('freehand-draw', { prop: 'freehandUpHandler', onPropertyChange: false,
|
|
11728
|
-
value: { e: e, canvas: parent.upperCanvas, context: this.upperContext } });
|
|
11729
|
-
}
|
|
11730
|
-
else {
|
|
11731
|
-
parent.currObjType.shape = '';
|
|
11732
|
-
}
|
|
11733
|
-
this.dragElement = '';
|
|
11734
|
-
this.mouseDown = '';
|
|
11735
|
-
parent.currObjType.isInitialLine = parent.currObjType.isDragging = false;
|
|
11736
|
-
this.selMouseUpEvent();
|
|
11737
11747
|
};
|
|
11738
11748
|
Selection.prototype.adjustActObjForLineArrow = function (obj) {
|
|
11739
11749
|
var isAdjusted = false;
|
|
@@ -13156,7 +13166,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13156
13166
|
fontStyle.push('underline');
|
|
13157
13167
|
}
|
|
13158
13168
|
}
|
|
13159
|
-
var _a = parent.activeObj.activePoint, startX = _a.startX, startY = _a.startY, width = _a.width, height = _a.height;
|
|
13169
|
+
var _a = parent.activeObj.activePoint, startX = _a.startX, startY = _a.startY, endX = _a.endX, endY = _a.endY, width = _a.width, height = _a.height;
|
|
13160
13170
|
var _b = parent.activeObj, keyHistory = _b.keyHistory, currIndex = _b.currIndex, shape = _b.shape, textSettings = _b.textSettings, strokeSettings = _b.strokeSettings, rotatedAngle = _b.rotatedAngle, imageElement = _b.imageElement, opacity = _b.opacity;
|
|
13161
13171
|
var shapeSettingsObj = {
|
|
13162
13172
|
id: !isNullOrUndefined(currIndex) ? currIndex : null,
|
|
@@ -13172,15 +13182,27 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13172
13182
|
fontFamily: shape === 'text' ? (textSettings ? textSettings.fontFamily : null) : null,
|
|
13173
13183
|
fontStyle: shape === 'text' ? fontStyle : null,
|
|
13174
13184
|
color: shape === 'text' ? (strokeSettings ? strokeSettings.strokeColor : null) : null,
|
|
13175
|
-
degree: shape === 'ellipse' || shape === 'rectangle' || shape === 'image' ? rotatedAngle * (180 / Math.PI) : null,
|
|
13185
|
+
degree: shape === 'ellipse' || shape === 'rectangle' || shape === 'image' || shape === 'text' ? rotatedAngle * (180 / Math.PI) : null,
|
|
13176
13186
|
imageData: shape === 'image' ? imageElement.src : null,
|
|
13177
|
-
opacity: shape === 'image' ? opacity : null
|
|
13187
|
+
opacity: shape === 'image' ? opacity : null,
|
|
13188
|
+
radiusX: shape === 'ellipse' ? width / 2 : null,
|
|
13189
|
+
radiusY: shape === 'ellipse' ? height / 2 : null,
|
|
13190
|
+
endX: shape === 'line' || shape === 'arrow' ? endX : null,
|
|
13191
|
+
endY: shape === 'line' || shape === 'arrow' ? endY : null,
|
|
13192
|
+
arrowHead: shape === 'arrow' ? this.getArrowType(parent.activeObj.start) : null,
|
|
13193
|
+
arrowTail: shape === 'arrow' ? this.getArrowType(parent.activeObj.end) : null,
|
|
13194
|
+
points: shape === 'path' ? parent.activeObj.pointColl : null
|
|
13178
13195
|
};
|
|
13179
13196
|
if (obj) {
|
|
13180
13197
|
obj['shapeSettingsObj'] = shapeSettingsObj;
|
|
13181
13198
|
}
|
|
13182
13199
|
return shapeSettingsObj;
|
|
13183
13200
|
};
|
|
13201
|
+
Selection.prototype.getArrowType = function (type) {
|
|
13202
|
+
var typeToArrowType = { 'none': 'None', 'arrow': 'Arrow', 'arrowSolid': 'SolidArrow',
|
|
13203
|
+
'circle': 'Circle', 'circleSolid': 'SolidCircle', 'square': 'Square', 'squareSolid': 'SolidSquare', 'bar': 'Bar' };
|
|
13204
|
+
return typeToArrowType["" + type];
|
|
13205
|
+
};
|
|
13184
13206
|
Selection.prototype.getRectanglePoints = function (rectX, rectY, rectWidth, rectHeight, rectAngle, pointX, pointY) {
|
|
13185
13207
|
var centerX = rectX + rectWidth / 2;
|
|
13186
13208
|
var centerY = rectY + rectHeight / 2;
|
|
@@ -14105,13 +14127,22 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
14105
14127
|
}
|
|
14106
14128
|
parent.activeObj.strokeSettings.strokeColor = shapeSettings.strokeColor;
|
|
14107
14129
|
parent.activeObj.strokeSettings.fillColor = shapeSettings.fillColor;
|
|
14130
|
+
parent.activeObj.strokeSettings.strokeWidth = shapeSettings.strokeWidth;
|
|
14108
14131
|
parent.activeObj.opacity = shapeSettings.opacity;
|
|
14109
14132
|
if (isNullOrUndefined(shapeSettings.degree)) {
|
|
14110
14133
|
shapeSettings.degree = 0;
|
|
14111
14134
|
}
|
|
14112
14135
|
switch (parent.activeObj.shape) {
|
|
14113
14136
|
case 'ellipse':
|
|
14114
|
-
|
|
14137
|
+
if (isBlazor()) {
|
|
14138
|
+
parent.activeObj.activePoint.width = shapeSettings.radius;
|
|
14139
|
+
}
|
|
14140
|
+
else {
|
|
14141
|
+
parent.activeObj.activePoint.width = shapeSettings.radiusX * 2;
|
|
14142
|
+
parent.activeObj.activePoint.height = shapeSettings.radiusY * 2;
|
|
14143
|
+
parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
|
|
14144
|
+
parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
|
|
14145
|
+
}
|
|
14115
14146
|
if (shapeSettings.degree) {
|
|
14116
14147
|
parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
|
|
14117
14148
|
}
|
|
@@ -14119,18 +14150,35 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
14119
14150
|
case 'line':
|
|
14120
14151
|
case 'arrow':
|
|
14121
14152
|
parent.activeObj.activePoint.width = shapeSettings.length;
|
|
14153
|
+
if (!isBlazor()) {
|
|
14154
|
+
parent.activeObj.activePoint.endX = shapeSettings.endX;
|
|
14155
|
+
parent.activeObj.activePoint.endY = shapeSettings.endY;
|
|
14156
|
+
parent.activeObj.activePoint.width = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
|
|
14157
|
+
parent.activeObj.activePoint.height = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
|
|
14158
|
+
if (parent.activeObj.shape === 'arrow') {
|
|
14159
|
+
parent.activeObj.start = this.getArrowType(shapeSettings.arrowHead);
|
|
14160
|
+
parent.activeObj.end = this.getArrowType(shapeSettings.arrowTail);
|
|
14161
|
+
}
|
|
14162
|
+
}
|
|
14122
14163
|
break;
|
|
14123
14164
|
case 'text':
|
|
14124
14165
|
parent.activeObj.keyHistory = parent.activeObj.textSettings.text = shapeSettings.text;
|
|
14125
14166
|
parent.activeObj.textSettings.fontSize = shapeSettings.fontSize;
|
|
14126
14167
|
parent.activeObj.strokeSettings.strokeColor = shapeSettings.color;
|
|
14127
14168
|
parent.activeObj.textSettings.fontFamily = shapeSettings.fontFamily;
|
|
14169
|
+
if (shapeSettings.degree) {
|
|
14170
|
+
parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
|
|
14171
|
+
}
|
|
14128
14172
|
break;
|
|
14129
14173
|
case 'rectangle':
|
|
14130
14174
|
case 'image':
|
|
14131
14175
|
if (shapeSettings.degree) {
|
|
14132
14176
|
parent.activeObj.rotatedAngle = shapeSettings.degree * (Math.PI / 180);
|
|
14133
14177
|
}
|
|
14178
|
+
// Prevented setting image src as it cannot be set in canvas
|
|
14179
|
+
break;
|
|
14180
|
+
case 'path':
|
|
14181
|
+
parent.activeObj.pointColl = shapeSettings.points;
|
|
14134
14182
|
break;
|
|
14135
14183
|
}
|
|
14136
14184
|
if (parent.activeObj.shape === 'text' && parent.activeObj.textSettings) {
|
|
@@ -16165,18 +16213,31 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
16165
16213
|
shapeDetails.strokeColor = obj.strokeSettings.strokeColor;
|
|
16166
16214
|
shapeDetails.fillColor = obj.strokeSettings.fillColor;
|
|
16167
16215
|
shapeDetails.strokeWidth = obj.strokeSettings.strokeWidth;
|
|
16216
|
+
shapeDetails.degree = obj.rotatedAngle * (180 / Math.PI);
|
|
16168
16217
|
break;
|
|
16169
16218
|
case 'ellipse':
|
|
16170
16219
|
shapeDetails.radius = obj.activePoint.width / 2;
|
|
16171
16220
|
shapeDetails.strokeColor = obj.strokeSettings.strokeColor;
|
|
16172
16221
|
shapeDetails.fillColor = obj.strokeSettings.fillColor;
|
|
16173
16222
|
shapeDetails.strokeWidth = obj.strokeSettings.strokeWidth;
|
|
16223
|
+
shapeDetails.radiusX = obj.activePoint.width / 2;
|
|
16224
|
+
shapeDetails.radiusY = obj.activePoint.height / 2;
|
|
16225
|
+
shapeDetails.degree = obj.rotatedAngle * (180 / Math.PI);
|
|
16174
16226
|
break;
|
|
16175
16227
|
case 'line':
|
|
16176
16228
|
case 'arrow':
|
|
16177
16229
|
shapeDetails.length = obj.activePoint.width;
|
|
16178
16230
|
shapeDetails.strokeColor = obj.strokeSettings.strokeColor;
|
|
16179
16231
|
shapeDetails.strokeWidth = obj.strokeSettings.strokeWidth;
|
|
16232
|
+
shapeDetails.endX = obj.activePoint.endX;
|
|
16233
|
+
shapeDetails.endY = obj.activePoint.endY;
|
|
16234
|
+
if (obj.shape === 'arrow') {
|
|
16235
|
+
var arrowObj = { type: null };
|
|
16236
|
+
parent.notify('selection', { prop: 'getArrowType', onPropertyChange: false, value: { type: obj.start, obj: arrowObj } });
|
|
16237
|
+
shapeDetails.arrowHead = arrowObj['type'];
|
|
16238
|
+
parent.notify('selection', { prop: 'getArrowType', onPropertyChange: false, value: { type: obj.end, obj: arrowObj } });
|
|
16239
|
+
shapeDetails.arrowTail = arrowObj['type'];
|
|
16240
|
+
}
|
|
16180
16241
|
break;
|
|
16181
16242
|
case 'text':
|
|
16182
16243
|
shapeDetails.text = obj.keyHistory;
|
|
@@ -16190,10 +16251,26 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
16190
16251
|
if (obj.textSettings.italic) {
|
|
16191
16252
|
shapeDetails.fontStyle.push('italic');
|
|
16192
16253
|
}
|
|
16254
|
+
shapeDetails.degree = obj.rotatedAngle * (180 / Math.PI);
|
|
16193
16255
|
break;
|
|
16194
16256
|
case 'path':
|
|
16195
16257
|
shapeDetails.strokeColor = obj.strokeSettings.strokeColor;
|
|
16196
16258
|
shapeDetails.strokeWidth = obj.strokeSettings.strokeWidth;
|
|
16259
|
+
shapeDetails.points = obj.pointColl;
|
|
16260
|
+
break;
|
|
16261
|
+
case 'image':
|
|
16262
|
+
shapeDetails.imageData = obj.imageCanvas.toDataURL();
|
|
16263
|
+
shapeDetails.degree = obj.rotatedAngle * (180 / Math.PI);
|
|
16264
|
+
shapeDetails.width = obj.activePoint.width;
|
|
16265
|
+
shapeDetails.height = obj.activePoint.height;
|
|
16266
|
+
shapeDetails.opacity = obj.opacity;
|
|
16267
|
+
break;
|
|
16268
|
+
case 'image':
|
|
16269
|
+
shapeDetails.imageData = obj.imageCanvas.toDataURL();
|
|
16270
|
+
shapeDetails.degree = obj.rotatedAngle * (180 / Math.PI);
|
|
16271
|
+
shapeDetails.width = obj.activePoint.width;
|
|
16272
|
+
shapeDetails.height = obj.activePoint.height;
|
|
16273
|
+
shapeDetails.opacity = obj.opacity;
|
|
16197
16274
|
break;
|
|
16198
16275
|
}
|
|
16199
16276
|
return shapeDetails;
|
|
@@ -20897,7 +20974,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
20897
20974
|
EventHandler.add(this.lowerCanvas, 'mousedown', this.canvasMouseDownHandler, this);
|
|
20898
20975
|
EventHandler.add(this.lowerCanvas, 'mousemove', this.canvasMouseMoveHandler, this);
|
|
20899
20976
|
EventHandler.add(this.lowerCanvas, 'mouseup', this.canvasMouseUpHandler, this);
|
|
20900
|
-
EventHandler.add(document, 'mouseup', this.canvasMouseUpHandler, this);
|
|
20901
20977
|
EventHandler.add(this.upperCanvas, 'touchstart', this.touchStartHandler, this);
|
|
20902
20978
|
EventHandler.add(this.lowerCanvas, 'touchstart', this.touchStartHandler, this);
|
|
20903
20979
|
EventHandler.add(this.lowerCanvas, 'mousewheel DOMMouseScroll', this.handleScroll, this);
|
|
@@ -20924,7 +21000,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
20924
21000
|
EventHandler.remove(this.lowerCanvas, 'mousedown', this.canvasMouseDownHandler);
|
|
20925
21001
|
EventHandler.remove(this.lowerCanvas, 'mousemove', this.canvasMouseMoveHandler);
|
|
20926
21002
|
EventHandler.remove(this.lowerCanvas, 'mouseup', this.canvasMouseUpHandler);
|
|
20927
|
-
EventHandler.remove(document, 'mouseup', this.canvasMouseUpHandler);
|
|
20928
21003
|
EventHandler.remove(this.upperCanvas, 'touchstart', this.touchStartHandler);
|
|
20929
21004
|
EventHandler.remove(this.lowerCanvas, 'touchstart', this.touchStartHandler);
|
|
20930
21005
|
EventHandler.remove(this.lowerCanvas, 'mousewheel DOMMouseScroll', this.handleScroll);
|
|
@@ -20937,7 +21012,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
20937
21012
|
this.notify('selection', { prop: 'unWireEvent', onPropertyChange: false });
|
|
20938
21013
|
};
|
|
20939
21014
|
ImageEditor.prototype.createCanvas = function () {
|
|
20940
|
-
var _this = this;
|
|
20941
21015
|
this.element.style.boxSizing = 'border-box';
|
|
20942
21016
|
var obj = { toolbarHeight: 0 };
|
|
20943
21017
|
this.notify('toolbar', { prop: 'getToolbarHeight', value: { obj: obj } });
|
|
@@ -21023,10 +21097,16 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
21023
21097
|
this.upperCanvas.style.cursor = this.cursor = 'default';
|
|
21024
21098
|
this.upperCanvas.style.display = 'block';
|
|
21025
21099
|
this.upperContext = this.upperCanvas.getContext('2d');
|
|
21026
|
-
|
|
21027
|
-
|
|
21100
|
+
dropAnchorElement.addEventListener('click', function (e) {
|
|
21101
|
+
e.preventDefault();
|
|
21102
|
+
dropUploader.click();
|
|
21028
21103
|
return false;
|
|
21029
|
-
};
|
|
21104
|
+
});
|
|
21105
|
+
minDropAnchorElem.addEventListener('click', function (e) {
|
|
21106
|
+
e.preventDefault();
|
|
21107
|
+
dropUploader.click();
|
|
21108
|
+
return false;
|
|
21109
|
+
});
|
|
21030
21110
|
};
|
|
21031
21111
|
ImageEditor.prototype.touchStartHandler = function (e) {
|
|
21032
21112
|
this.notify('selection', { prop: 'touchStartHandler', onPropertyChange: false, value: { e: e } });
|
|
@@ -21154,6 +21234,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
21154
21234
|
*/
|
|
21155
21235
|
ImageEditor.prototype.getImageData = function () {
|
|
21156
21236
|
var obj = { canvas: null };
|
|
21237
|
+
if (this.textArea.style.display === 'block' || this.textArea.style.display === 'inline-block') {
|
|
21238
|
+
this.okBtn();
|
|
21239
|
+
}
|
|
21157
21240
|
this.notify('export', { prop: 'exportToCanvas', value: { object: obj } });
|
|
21158
21241
|
return obj['canvas'].getContext('2d').getImageData(0, 0, obj['canvas'].width, obj['canvas'].height);
|
|
21159
21242
|
};
|
|
@@ -28656,6 +28739,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
28656
28739
|
step: step, width: Browser.isDevice ? '180px' : (type === 'straighten' ? '200px' : '300px'),
|
|
28657
28740
|
cssClass: 'e-slider',
|
|
28658
28741
|
change: function (args) {
|
|
28742
|
+
parent.notify('selection', { prop: 'setSliderActive', onPropertyChange: false, value: { bool: true } });
|
|
28659
28743
|
if (type === 'transparency') {
|
|
28660
28744
|
if (parent.activeObj.shape) {
|
|
28661
28745
|
var prevCropObj = void 0;
|
|
@@ -28708,6 +28792,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
28708
28792
|
parent.notify('selection', { prop: 'setSliding', value: { bool: false } });
|
|
28709
28793
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
28710
28794
|
}
|
|
28795
|
+
parent.notify('selection', { prop: 'setSliderActive', onPropertyChange: false, value: { bool: false } });
|
|
28711
28796
|
}
|
|
28712
28797
|
});
|
|
28713
28798
|
};
|