@syncfusion/ej2-image-editor 23.1.43 → 23.2.4
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 +4 -2
- 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 +304 -162
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +302 -160
- 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 +177 -133
- package/src/image-editor/action/selection.js +37 -1
- package/src/image-editor/action/shape.d.ts +1 -0
- package/src/image-editor/action/shape.js +14 -0
- package/src/image-editor/action/transform.js +3 -0
- package/src/image-editor/base/image-editor.js +3 -1
- package/src/image-editor/renderer/toolbar.js +69 -26
- package/styles/bootstrap-dark.css +14 -3
- package/styles/bootstrap.css +14 -3
- package/styles/bootstrap4.css +14 -3
- package/styles/bootstrap5-dark.css +14 -3
- package/styles/bootstrap5.css +14 -3
- package/styles/fabric-dark.css +14 -3
- package/styles/fabric.css +14 -3
- package/styles/fluent-dark.css +14 -3
- package/styles/fluent.css +14 -3
- package/styles/highcontrast-light.css +14 -3
- package/styles/highcontrast.css +14 -3
- package/styles/image-editor/_bootstrap-dark-definition.scss +4 -0
- package/styles/image-editor/_bootstrap-definition.scss +4 -0
- package/styles/image-editor/_bootstrap4-definition.scss +4 -0
- package/styles/image-editor/_bootstrap5-definition.scss +4 -0
- package/styles/image-editor/_fabric-dark-definition.scss +4 -0
- package/styles/image-editor/_fabric-definition.scss +4 -0
- package/styles/image-editor/_fluent-definition.scss +4 -0
- package/styles/image-editor/_fusionnew-definition.scss +4 -0
- package/styles/image-editor/_highcontrast-definition.scss +4 -0
- package/styles/image-editor/_highcontrast-light-definition.scss +4 -0
- package/styles/image-editor/_layout.scss +21 -7
- package/styles/image-editor/_material-dark-definition.scss +4 -0
- package/styles/image-editor/_material-definition.scss +4 -0
- package/styles/image-editor/_material3-definition.scss +4 -0
- package/styles/image-editor/_tailwind-definition.scss +4 -0
- package/styles/image-editor/bootstrap-dark.css +14 -3
- package/styles/image-editor/bootstrap.css +14 -3
- package/styles/image-editor/bootstrap4.css +14 -3
- package/styles/image-editor/bootstrap5-dark.css +14 -3
- package/styles/image-editor/bootstrap5.css +14 -3
- package/styles/image-editor/fabric-dark.css +14 -3
- package/styles/image-editor/fabric.css +14 -3
- package/styles/image-editor/fluent-dark.css +14 -3
- package/styles/image-editor/fluent.css +14 -3
- package/styles/image-editor/highcontrast-light.css +14 -3
- package/styles/image-editor/highcontrast.css +14 -3
- package/styles/image-editor/material-dark.css +14 -3
- package/styles/image-editor/material.css +14 -3
- package/styles/image-editor/material3-dark.css +19 -4
- package/styles/image-editor/material3.css +19 -4
- package/styles/image-editor/tailwind-dark.css +14 -3
- package/styles/image-editor/tailwind.css +14 -3
- package/styles/material-dark.css +14 -3
- package/styles/material.css +14 -3
- package/styles/material3-dark.css +19 -4
- package/styles/material3.css +19 -4
- package/styles/tailwind-dark.css +14 -3
- package/styles/tailwind.css +14 -3
|
@@ -2450,6 +2450,7 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2450
2450
|
};
|
|
2451
2451
|
Draw.prototype.shapeImage = function (canvasDraw) {
|
|
2452
2452
|
var parent = this.parent;
|
|
2453
|
+
var actObj = extend({}, parent.activeObj);
|
|
2453
2454
|
var ctx = parent.activeObj.imageCanvas.getContext('2d');
|
|
2454
2455
|
if (canvasDraw === this.lowerContext && this.isImageApply) {
|
|
2455
2456
|
var dimObj = { width: 0, height: 0 };
|
|
@@ -2472,41 +2473,17 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2472
2473
|
parent.activeObj.flipObjColl = [];
|
|
2473
2474
|
parent.activeObj.shapeFlip = '';
|
|
2474
2475
|
}
|
|
2475
|
-
for (var j = 0, len = parent.activeObj.flipObjColl.length; j < len; j++) {
|
|
2476
|
-
if (parent.activeObj.flipObjColl[j].toLowerCase() === 'horizontal') {
|
|
2477
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2478
|
-
canvasDraw.scale(-1, 1);
|
|
2479
|
-
parent.activeObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2480
|
-
}
|
|
2481
|
-
else if (parent.activeObj.flipObjColl[j].toLowerCase() === 'vertical') {
|
|
2482
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2483
|
-
canvasDraw.scale(1, -1);
|
|
2484
|
-
parent.activeObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
2476
|
imgPoint.startX = ((parent.activeObj.activePoint.width - imgPoint.width) / 2) + parent.activeObj.activePoint.startX;
|
|
2488
2477
|
imgPoint.startY = ((parent.activeObj.activePoint.height - imgPoint.height) / 2) + parent.activeObj.activePoint.startY;
|
|
2489
2478
|
var temp = canvasDraw.globalAlpha;
|
|
2490
2479
|
canvasDraw.globalAlpha = parent.activeObj.imageTransparency;
|
|
2491
|
-
if (
|
|
2480
|
+
if (actObj.rotateFlipColl && actObj.rotateFlipColl.length > 0) {
|
|
2492
2481
|
this.rotateImage(canvasDraw);
|
|
2493
2482
|
}
|
|
2494
2483
|
else {
|
|
2495
2484
|
canvasDraw.drawImage(parent.activeObj.imageCanvas, imgPoint.startX, imgPoint.startY, imgPoint.width, imgPoint.height);
|
|
2496
2485
|
}
|
|
2497
2486
|
canvasDraw.globalAlpha = temp;
|
|
2498
|
-
for (var k = 0, len = parent.activeObj.flipObjColl.length; k < len; k++) {
|
|
2499
|
-
if (parent.activeObj.flipObjColl[k].toLowerCase() === 'horizontal') {
|
|
2500
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2501
|
-
canvasDraw.scale(-1, 1);
|
|
2502
|
-
parent.activeObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2503
|
-
}
|
|
2504
|
-
else if (parent.activeObj.flipObjColl[k].toLowerCase() === 'vertical') {
|
|
2505
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2506
|
-
canvasDraw.scale(1, -1);
|
|
2507
|
-
parent.activeObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
2487
|
parent.currObjType.isText = false;
|
|
2511
2488
|
};
|
|
2512
2489
|
Draw.prototype.shapeText = function (canvasDraw) {
|
|
@@ -2514,6 +2491,7 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2514
2491
|
canvasDraw.filter = 'none';
|
|
2515
2492
|
var parent = this.parent;
|
|
2516
2493
|
var actPoint = parent.activeObj.activePoint;
|
|
2494
|
+
var actObj = extend({}, parent.activeObj);
|
|
2517
2495
|
var rows = parent.activeObj.keyHistory.split('\n');
|
|
2518
2496
|
var height = parent.activeObj.textSettings.fontSize + parent.activeObj.textSettings.fontSize * 0.25;
|
|
2519
2497
|
var lineHeight = ((height * rows.length) - (parent.activeObj.textSettings.fontSize * rows.length)) / rows.length;
|
|
@@ -2553,36 +2531,12 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2553
2531
|
parent.activeObj.flipObjColl = [];
|
|
2554
2532
|
parent.activeObj.shapeFlip = '';
|
|
2555
2533
|
}
|
|
2556
|
-
|
|
2557
|
-
if (parent.activeObj.flipObjColl[j].toLowerCase() === 'horizontal') {
|
|
2558
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2559
|
-
canvasDraw.scale(-1, 1);
|
|
2560
|
-
actPoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2561
|
-
}
|
|
2562
|
-
else if (parent.activeObj.flipObjColl[j].toLowerCase() === 'vertical') {
|
|
2563
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2564
|
-
canvasDraw.scale(1, -1);
|
|
2565
|
-
actPoint = this.updateActPoint('vertical', canvasDraw);
|
|
2566
|
-
}
|
|
2567
|
-
}
|
|
2568
|
-
if (parent.activeObj.shapeDegree !== parent.transform.degree) {
|
|
2534
|
+
if (actObj.rotateFlipColl && actObj.rotateFlipColl.length > 0) {
|
|
2569
2535
|
this.rotateText(canvasDraw);
|
|
2570
2536
|
}
|
|
2571
2537
|
else {
|
|
2572
2538
|
canvasDraw.fillText(text, actPoint.startX + parent.activeObj.textSettings.fontSize * 0.1, actPoint.startY + yPoint);
|
|
2573
2539
|
}
|
|
2574
|
-
for (var k = 0, len = parent.activeObj.flipObjColl.length; k < len; k++) {
|
|
2575
|
-
if (parent.activeObj.flipObjColl[k].toLowerCase() === 'horizontal') {
|
|
2576
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2577
|
-
canvasDraw.scale(-1, 1);
|
|
2578
|
-
actPoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2579
|
-
}
|
|
2580
|
-
else if (parent.activeObj.flipObjColl[k].toLowerCase() === 'vertical') {
|
|
2581
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2582
|
-
canvasDraw.scale(1, -1);
|
|
2583
|
-
actPoint = this.updateActPoint('vertical', canvasDraw);
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
2540
|
}
|
|
2587
2541
|
canvasDraw.filter = filter;
|
|
2588
2542
|
parent.currObjType.isText = false;
|
|
@@ -2622,6 +2576,8 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2622
2576
|
Draw.prototype.rotateImage = function (canvasDraw) {
|
|
2623
2577
|
var parent = this.parent;
|
|
2624
2578
|
var degree;
|
|
2579
|
+
var actObj = parent.activeObj;
|
|
2580
|
+
var tempActiveObj = extend({}, parent.activeObj, null, true);
|
|
2625
2581
|
if (parent.activeObj.shapeDegree === 0) {
|
|
2626
2582
|
degree = parent.transform.degree;
|
|
2627
2583
|
}
|
|
@@ -2642,49 +2598,91 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2642
2598
|
imgPoint.startY = parent.activeObj.activePoint.startY;
|
|
2643
2599
|
var startX = imgPoint.startX;
|
|
2644
2600
|
var startY = imgPoint.startY;
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2601
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2602
|
+
var tempDegree;
|
|
2603
|
+
var tempColl = [];
|
|
2604
|
+
canvasDraw.save();
|
|
2605
|
+
for (var i = 0, len = actObj.rotateFlipColl.length; i < len; i++) {
|
|
2606
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2607
|
+
var coll = actObj.rotateFlipColl[i];
|
|
2608
|
+
tempColl.push(coll);
|
|
2609
|
+
if (typeof (coll) === 'number') {
|
|
2610
|
+
if (actObj.shapeDegree === 0) {
|
|
2611
|
+
tempDegree = coll;
|
|
2612
|
+
}
|
|
2613
|
+
else {
|
|
2614
|
+
tempDegree = coll - actObj.shapeDegree;
|
|
2615
|
+
}
|
|
2616
|
+
if (tempDegree === -450) {
|
|
2617
|
+
tempDegree = -90;
|
|
2618
|
+
}
|
|
2619
|
+
if (tempDegree < 0) {
|
|
2620
|
+
tempDegree = 360 + tempDegree;
|
|
2621
|
+
}
|
|
2622
|
+
imgPoint.width = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.height : actObj.activePoint.width;
|
|
2623
|
+
imgPoint.height = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.width :
|
|
2624
|
+
actObj.activePoint.height;
|
|
2625
|
+
canvasDraw.translate(canvasDraw.canvas.width / 2, canvasDraw.canvas.height / 2);
|
|
2626
|
+
canvasDraw.rotate(Math.PI / 180 * coll);
|
|
2627
|
+
canvasDraw.translate(-canvasDraw.canvas.height / 2, -canvasDraw.canvas.width / 2);
|
|
2628
|
+
if (tempDegree % 90 === 0 && tempDegree % 270 !== 0) {
|
|
2629
|
+
startY = canvasDraw.canvas.width - (actObj.activePoint.startX + actObj.activePoint.width);
|
|
2630
|
+
startY += ((actObj.activePoint.width - imgPoint.height) / 2);
|
|
2631
|
+
startX = imgPoint.startY;
|
|
2632
|
+
}
|
|
2633
|
+
else if (tempDegree % 270 === 0) {
|
|
2634
|
+
startX = canvasDraw.canvas.height - (actObj.activePoint.startY + actObj.activePoint.height);
|
|
2635
|
+
startX += ((actObj.activePoint.height - imgPoint.width) / 2);
|
|
2636
|
+
startY = imgPoint.startX;
|
|
2637
|
+
}
|
|
2638
|
+
imgPoint.startX = startX;
|
|
2639
|
+
imgPoint.startY = startY;
|
|
2640
|
+
actObj.activePoint.startX = startX;
|
|
2641
|
+
actObj.activePoint.startY = startY;
|
|
2642
|
+
actObj.activePoint.endX = actObj.activePoint.startX + imgPoint.width;
|
|
2643
|
+
actObj.activePoint.endY = actObj.activePoint.startY + imgPoint.height;
|
|
2644
|
+
actObj = this.updateWidthHeight(actObj);
|
|
2645
|
+
}
|
|
2646
|
+
else {
|
|
2647
|
+
if (coll === 'horizontal' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2648
|
+
coll = 'vertical';
|
|
2649
|
+
}
|
|
2650
|
+
else if (coll === 'vertical' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2651
|
+
coll = 'horizontal';
|
|
2652
|
+
}
|
|
2653
|
+
if (coll === 'horizontal') {
|
|
2654
|
+
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2655
|
+
canvasDraw.scale(-1, 1);
|
|
2656
|
+
actObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2657
|
+
}
|
|
2658
|
+
else if (coll === 'vertical') {
|
|
2659
|
+
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2660
|
+
canvasDraw.scale(1, -1);
|
|
2661
|
+
actObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2662
|
+
}
|
|
2663
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2664
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2665
|
+
}
|
|
2666
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2667
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2668
|
+
startX = imgPoint.startX;
|
|
2669
|
+
startY = imgPoint.startY;
|
|
2666
2670
|
}
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
canvasDraw.rotate(Math.PI / 180 * degree);
|
|
2670
|
-
startX = parent.lowerCanvas.width - (imgPoint.startX + imgPoint.width);
|
|
2671
|
-
startY = parent.lowerCanvas.height - (imgPoint.startY + imgPoint.height);
|
|
2672
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2673
|
-
canvasDraw.drawImage(parent.activeObj.imageCanvas, startX, startY, imgPoint.width, imgPoint.height);
|
|
2674
|
-
canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
|
|
2675
|
-
canvasDraw.rotate(Math.PI / 180 * -degree);
|
|
2676
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2671
|
+
if (actObj.rotatedAngle !== 0) {
|
|
2672
|
+
parent.notify('shape', { prop: 'setPointCollForShapeRotation', onPropertyChange: false, value: { obj: actObj } });
|
|
2677
2673
|
}
|
|
2674
|
+
canvasDraw.drawImage(actObj.imageCanvas, imgPoint.startX, imgPoint.startY, imgPoint.width, imgPoint.height);
|
|
2675
|
+
canvasDraw.restore();
|
|
2676
|
+
parent.activeObj = tempActiveObj;
|
|
2678
2677
|
if (parent.transform.degree === 360 || parent.transform.degree === -360) {
|
|
2679
2678
|
parent.transform.degree = 0;
|
|
2680
2679
|
}
|
|
2681
2680
|
};
|
|
2682
2681
|
Draw.prototype.rotateText = function (canvasDraw) {
|
|
2683
2682
|
var parent = this.parent;
|
|
2684
|
-
var startX = parent.activeObj.activePoint.startX;
|
|
2685
|
-
var startY = parent.activeObj.activePoint.startY;
|
|
2686
2683
|
var degree;
|
|
2687
|
-
var
|
|
2684
|
+
var actObj = parent.activeObj;
|
|
2685
|
+
var tempActiveObj = extend({}, parent.activeObj, null, true);
|
|
2688
2686
|
if (parent.activeObj.shapeDegree === 0) {
|
|
2689
2687
|
degree = parent.transform.degree;
|
|
2690
2688
|
}
|
|
@@ -2697,45 +2695,89 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2697
2695
|
if (degree < 0) {
|
|
2698
2696
|
degree = 360 + degree;
|
|
2699
2697
|
}
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2698
|
+
var imgPoint = { startX: 0, startY: 0, width: 0, height: 0 };
|
|
2699
|
+
imgPoint.width = degree % 90 === 0 && degree % 180 !== 0 ? actObj.activePoint.height : actObj.activePoint.width;
|
|
2700
|
+
imgPoint.height = degree % 90 === 0 && degree % 180 !== 0 ? actObj.activePoint.width :
|
|
2701
|
+
actObj.activePoint.height;
|
|
2702
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2703
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2704
|
+
var startX = imgPoint.startX;
|
|
2705
|
+
var startY = imgPoint.startY;
|
|
2706
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2707
|
+
var tempDegree;
|
|
2708
|
+
var tempColl = [];
|
|
2709
|
+
canvasDraw.save();
|
|
2710
|
+
for (var i = 0, len = actObj.rotateFlipColl.length; i < len; i++) {
|
|
2711
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2712
|
+
var coll = actObj.rotateFlipColl[i];
|
|
2713
|
+
tempColl.push(coll);
|
|
2714
|
+
if (typeof (coll) === 'number') {
|
|
2715
|
+
if (actObj.shapeDegree === 0) {
|
|
2716
|
+
tempDegree = coll;
|
|
2717
|
+
}
|
|
2718
|
+
else {
|
|
2719
|
+
tempDegree = coll - actObj.shapeDegree;
|
|
2720
|
+
}
|
|
2721
|
+
if (tempDegree === -450) {
|
|
2722
|
+
tempDegree = -90;
|
|
2723
|
+
}
|
|
2724
|
+
if (tempDegree < 0) {
|
|
2725
|
+
tempDegree = 360 + tempDegree;
|
|
2726
|
+
}
|
|
2727
|
+
imgPoint.width = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.height : actObj.activePoint.width;
|
|
2728
|
+
imgPoint.height = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.width :
|
|
2729
|
+
actObj.activePoint.height;
|
|
2730
|
+
canvasDraw.translate(canvasDraw.canvas.width / 2, canvasDraw.canvas.height / 2);
|
|
2731
|
+
canvasDraw.rotate(Math.PI / 180 * coll);
|
|
2732
|
+
canvasDraw.translate(-canvasDraw.canvas.height / 2, -canvasDraw.canvas.width / 2);
|
|
2733
|
+
if (tempDegree % 90 === 0 && tempDegree % 270 !== 0) {
|
|
2734
|
+
startY = (parent.lowerCanvas.width - actObj.activePoint.endX);
|
|
2735
|
+
startX = actObj.activePoint.startY;
|
|
2736
|
+
}
|
|
2737
|
+
else if (tempDegree % 270 === 0) {
|
|
2738
|
+
startX = parent.lowerCanvas.height - actObj.activePoint.endY;
|
|
2739
|
+
startY = actObj.activePoint.startX;
|
|
2740
|
+
}
|
|
2741
|
+
imgPoint.startX = startX;
|
|
2742
|
+
imgPoint.startY = startY;
|
|
2743
|
+
actObj.activePoint.startX = startX;
|
|
2744
|
+
actObj.activePoint.startY = startY;
|
|
2745
|
+
actObj.activePoint.endX = actObj.activePoint.startX + imgPoint.width;
|
|
2746
|
+
actObj.activePoint.endY = actObj.activePoint.startY + imgPoint.height;
|
|
2747
|
+
actObj = this.updateWidthHeight(actObj);
|
|
2748
|
+
}
|
|
2749
|
+
else {
|
|
2750
|
+
if (coll === 'horizontal' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2751
|
+
coll = 'vertical';
|
|
2752
|
+
}
|
|
2753
|
+
else if (coll === 'vertical' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2754
|
+
coll = 'horizontal';
|
|
2755
|
+
}
|
|
2756
|
+
if (coll === 'horizontal') {
|
|
2757
|
+
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2758
|
+
canvasDraw.scale(-1, 1);
|
|
2759
|
+
actObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2760
|
+
}
|
|
2761
|
+
else if (coll === 'vertical') {
|
|
2762
|
+
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2763
|
+
canvasDraw.scale(1, -1);
|
|
2764
|
+
actObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2765
|
+
}
|
|
2766
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2767
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2768
|
+
}
|
|
2769
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2770
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2771
|
+
startX = imgPoint.startX;
|
|
2772
|
+
startY = imgPoint.startY;
|
|
2726
2773
|
}
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
canvasDraw.rotate(Math.PI / 180 * degree);
|
|
2730
|
-
startX = parent.lowerCanvas.width - actPoint.endX;
|
|
2731
|
-
startY = (parent.lowerCanvas.height - actPoint.endY) +
|
|
2732
|
-
parent.activeObj.textSettings.fontSize * 0.4;
|
|
2733
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2734
|
-
this.textFlipDegree(canvasDraw, startX, startY);
|
|
2735
|
-
canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
|
|
2736
|
-
canvasDraw.rotate(Math.PI / 180 * -degree);
|
|
2737
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2774
|
+
if (actObj.rotatedAngle !== 0) {
|
|
2775
|
+
parent.notify('shape', { prop: 'setPointCollForShapeRotation', onPropertyChange: false, value: { obj: actObj } });
|
|
2738
2776
|
}
|
|
2777
|
+
startY += actObj.textSettings.fontSize * 0.4;
|
|
2778
|
+
this.textFlipDegree(canvasDraw, startX, startY);
|
|
2779
|
+
canvasDraw.restore();
|
|
2780
|
+
parent.activeObj = tempActiveObj;
|
|
2739
2781
|
if (parent.transform.degree === 360 || parent.transform.degree === -360) {
|
|
2740
2782
|
parent.transform.degree = 0;
|
|
2741
2783
|
}
|
|
@@ -3270,22 +3312,23 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
3270
3312
|
this.parent.notify('toolbar', { prop: 'getPrevCropObj', onPropertyChange: false, value: { obj: obj1 } });
|
|
3271
3313
|
this.parent.notify('toolbar', { prop: 'getPrevObj', onPropertyChange: false, value: { obj: obj2 } });
|
|
3272
3314
|
if (obj1['prevCropObj'] && obj2['prevObj']) {
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3315
|
+
parent.objColl = [];
|
|
3316
|
+
parent.pointColl = [];
|
|
3317
|
+
parent.freehandCounter = 0;
|
|
3318
|
+
parent.cropObj = extend({}, obj1['prevCropObj'], {}, true);
|
|
3319
|
+
this.setCurrentObj(obj2['prevObj']);
|
|
3320
|
+
parent.objColl = obj2['prevObj']['objColl'];
|
|
3321
|
+
parent.pointColl = obj2['prevObj']['pointColl'];
|
|
3322
|
+
parent.freehandCounter = parent.pointColl.length;
|
|
3323
|
+
parent.notify('shape', { prop: 'zoomObjColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
3324
|
+
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
3325
|
+
var currObj = parent.currSelectionPoint ?
|
|
3326
|
+
extend({}, parent.currSelectionPoint, {}, true) : null;
|
|
3285
3327
|
this.parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3286
3328
|
value: { zoomFactor: -this.parent.transform.zoomFactor, zoomPoint: null, isResize: true } });
|
|
3287
3329
|
this.parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3288
3330
|
value: { zoomFactor: obj2['prevObj']['defaultZoom'], zoomPoint: null, isResize: true } });
|
|
3331
|
+
parent.currSelectionPoint = currObj;
|
|
3289
3332
|
if (obj2['prevObj'].zoomFactor) {
|
|
3290
3333
|
parent.setProperties({ zoomSettings: { zoomFactor: obj2['prevObj'].zoomFactor } }, true);
|
|
3291
3334
|
}
|
|
@@ -3293,6 +3336,7 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
3293
3336
|
value: { previousZoomValue: parent.zoomSettings.zoomFactor } });
|
|
3294
3337
|
}
|
|
3295
3338
|
parent.isResize = false;
|
|
3339
|
+
parent.notify('transform', { prop: 'setResizedImgAngle', onPropertyChange: false, value: { angle: null } });
|
|
3296
3340
|
}
|
|
3297
3341
|
}
|
|
3298
3342
|
if (parent.togglePen) {
|
|
@@ -11049,6 +11093,36 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11049
11093
|
parent.notify('transform', { prop: 'resize', value: { width: point.x, height: point.y, isAspectRatio: false } });
|
|
11050
11094
|
}
|
|
11051
11095
|
}
|
|
11096
|
+
if (isBlazor()) {
|
|
11097
|
+
var aspectRatioHeight = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
|
|
11098
|
+
var aspectRatioWidth = this.parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-numerictextbox');
|
|
11099
|
+
if ((blrAspRatElem && blrAspRatElem.classList.contains('e-hidden'))) {
|
|
11100
|
+
if (aspectRatioHeight && aspectRatioHeight.value === "") {
|
|
11101
|
+
aspectRatioHeight.value = aspectRatioHeight.placeholder;
|
|
11102
|
+
aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString();
|
|
11103
|
+
}
|
|
11104
|
+
if (aspectRatioWidth && aspectRatioWidth.value === "") {
|
|
11105
|
+
aspectRatioWidth.value = aspectRatioWidth.placeholder;
|
|
11106
|
+
aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString();
|
|
11107
|
+
}
|
|
11108
|
+
}
|
|
11109
|
+
}
|
|
11110
|
+
else {
|
|
11111
|
+
var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
11112
|
+
var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
11113
|
+
if (isNullOrUndefined(aspectRatioElement)) {
|
|
11114
|
+
var elem = getComponent(aspectRatioHeight, 'numerictextbox');
|
|
11115
|
+
if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
|
|
11116
|
+
elem.value = parseFloat(elem.placeholder);
|
|
11117
|
+
aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
|
|
11118
|
+
}
|
|
11119
|
+
elem = getComponent(aspectRatioWidth, 'numerictextbox');
|
|
11120
|
+
if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
|
|
11121
|
+
elem.value = parseFloat(elem.placeholder);
|
|
11122
|
+
aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
|
|
11123
|
+
}
|
|
11124
|
+
}
|
|
11125
|
+
}
|
|
11052
11126
|
}
|
|
11053
11127
|
else {
|
|
11054
11128
|
var splitWords = void 0;
|
|
@@ -12007,6 +12081,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12007
12081
|
if (widthElement && heightElement) {
|
|
12008
12082
|
var heightString = heightElement.value.replace(/,/g, '');
|
|
12009
12083
|
var widthString = widthElement.value.replace(/,/g, '');
|
|
12084
|
+
if (heightString === '') {
|
|
12085
|
+
heightString = heightElement.placeholder.replace(/,/g, '');
|
|
12086
|
+
}
|
|
12087
|
+
if (widthString === '') {
|
|
12088
|
+
widthString = widthElement.placeholder.replace(/,/g, '');
|
|
12089
|
+
}
|
|
12010
12090
|
height = parseFloat(heightString);
|
|
12011
12091
|
width = parseFloat(widthString);
|
|
12012
12092
|
}
|
|
@@ -12246,6 +12326,9 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
12246
12326
|
case 'updateObj':
|
|
12247
12327
|
this.updateObj(args.value['dimObj'], args.value['x'], args.value['y']);
|
|
12248
12328
|
break;
|
|
12329
|
+
case 'updateSelectionChangeEventArgs':
|
|
12330
|
+
this.updateSelectionChangeEventArgs(args.value['selectionSettings']);
|
|
12331
|
+
break;
|
|
12249
12332
|
}
|
|
12250
12333
|
};
|
|
12251
12334
|
Shape.prototype.getModuleName = function () {
|
|
@@ -12812,6 +12895,17 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
12812
12895
|
}
|
|
12813
12896
|
}
|
|
12814
12897
|
};
|
|
12898
|
+
Shape.prototype.updateSelectionChangeEventArgs = function (selectionSettings) {
|
|
12899
|
+
var parent = this.parent;
|
|
12900
|
+
parent.activeObj.activePoint.startX = selectionSettings.startX;
|
|
12901
|
+
parent.activeObj.activePoint.startY = selectionSettings.startY;
|
|
12902
|
+
if (selectionSettings.width && selectionSettings.height) {
|
|
12903
|
+
parent.activeObj.activePoint.width = selectionSettings.width;
|
|
12904
|
+
parent.activeObj.activePoint.height = selectionSettings.height;
|
|
12905
|
+
parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
|
|
12906
|
+
parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
|
|
12907
|
+
}
|
|
12908
|
+
};
|
|
12815
12909
|
Shape.prototype.addLetter = function (letter) {
|
|
12816
12910
|
var parent = this.parent;
|
|
12817
12911
|
if (parent.textArea.style.display === 'none' && (parent.currObjType.isText || parent.activeObj.shape === 'text')) {
|
|
@@ -15179,6 +15273,9 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
15179
15273
|
case 'resize':
|
|
15180
15274
|
this.resize(args.value['width'], args.value['height'], args.value['isAspectRatio']);
|
|
15181
15275
|
break;
|
|
15276
|
+
case 'setResizedImgAngle':
|
|
15277
|
+
this.resizedImgAngle = args.value['angle'];
|
|
15278
|
+
break;
|
|
15182
15279
|
case 'reset':
|
|
15183
15280
|
this.reset();
|
|
15184
15281
|
break;
|
|
@@ -19158,6 +19255,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
19158
19255
|
this.afterCropActions = [];
|
|
19159
19256
|
this.currentFilter = '';
|
|
19160
19257
|
this.tempFrameZoomLevel = null;
|
|
19258
|
+
this.cxtTbarHeight = null;
|
|
19161
19259
|
var obj_1 = { initialZoomValue: false };
|
|
19162
19260
|
this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
|
|
19163
19261
|
if (obj_1['initialZoomValue']) {
|
|
@@ -19805,7 +19903,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
19805
19903
|
value = 'vertical';
|
|
19806
19904
|
}
|
|
19807
19905
|
for (var i = 0; i < this.objColl.length; i++) {
|
|
19808
|
-
|
|
19906
|
+
var shape = this.objColl[i].shape;
|
|
19907
|
+
if (shape === 'image' || shape === 'text') {
|
|
19809
19908
|
if (isNullOrUndefined(this.objColl[i].rotateFlipColl)) {
|
|
19810
19909
|
this.objColl[i].rotateFlipColl = [];
|
|
19811
19910
|
}
|
|
@@ -22224,19 +22323,32 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
22224
22323
|
var parent = this.parent;
|
|
22225
22324
|
var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
22226
22325
|
var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
22227
|
-
var
|
|
22326
|
+
var icon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
|
|
22228
22327
|
var originalWidth = parent.img.destWidth;
|
|
22229
22328
|
var originalHeight = parent.img.destHeight;
|
|
22230
22329
|
var aspectRatioHeightValue = parseFloat(aspectRatioHeight.value);
|
|
22231
22330
|
var width = Math.floor((aspectRatioHeightValue / (originalHeight / originalWidth)));
|
|
22232
|
-
|
|
22331
|
+
var widthNumeric = getComponent(aspectRatioWidth, 'numerictextbox');
|
|
22332
|
+
if (icon) {
|
|
22233
22333
|
if (width != null && !isNaN(width)) {
|
|
22234
|
-
|
|
22235
|
-
|
|
22334
|
+
if (isNullOrUndefined(widthNumeric.value)) {
|
|
22335
|
+
widthNumeric.placeholder = width + ' px';
|
|
22336
|
+
aspectRatioWidth.placeholder = width.toString() + ' px';
|
|
22337
|
+
}
|
|
22338
|
+
else {
|
|
22339
|
+
widthNumeric.value = width;
|
|
22340
|
+
aspectRatioWidth.value = width.toString() + ' px';
|
|
22341
|
+
}
|
|
22236
22342
|
}
|
|
22237
22343
|
else {
|
|
22238
|
-
|
|
22239
|
-
|
|
22344
|
+
if (isNullOrUndefined(widthNumeric.value)) {
|
|
22345
|
+
widthNumeric.placeholder = '0 px';
|
|
22346
|
+
aspectRatioWidth.placeholder = '0 px';
|
|
22347
|
+
}
|
|
22348
|
+
else {
|
|
22349
|
+
widthNumeric.value = 0;
|
|
22350
|
+
aspectRatioWidth.value = '0 px';
|
|
22351
|
+
}
|
|
22240
22352
|
}
|
|
22241
22353
|
}
|
|
22242
22354
|
};
|
|
@@ -22245,37 +22357,53 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
22245
22357
|
var parent = this.parent;
|
|
22246
22358
|
var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
22247
22359
|
var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
22248
|
-
var
|
|
22360
|
+
var icon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
|
|
22249
22361
|
var originalWidth = parent.img.destWidth;
|
|
22250
22362
|
var originalHeight = parent.img.destHeight;
|
|
22251
22363
|
var aspectRatioWidthValue = parseFloat(aspectRatioWidth.value);
|
|
22252
22364
|
var height = Math.floor((aspectRatioWidthValue / (originalWidth / originalHeight)));
|
|
22253
|
-
|
|
22254
|
-
|
|
22255
|
-
|
|
22256
|
-
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22365
|
+
var heightNumeric = getComponent(aspectRatioHeight, 'numerictextbox');
|
|
22366
|
+
if (icon) {
|
|
22367
|
+
if (!isNaN(height)) {
|
|
22368
|
+
if (isNullOrUndefined(heightNumeric.value)) {
|
|
22369
|
+
heightNumeric.placeholder = height + ' px';
|
|
22370
|
+
aspectRatioHeight.placeholder = height.toString() + ' px';
|
|
22371
|
+
}
|
|
22372
|
+
else {
|
|
22373
|
+
heightNumeric.value = height;
|
|
22374
|
+
aspectRatioHeight.value = height.toString() + ' px';
|
|
22375
|
+
}
|
|
22376
|
+
}
|
|
22377
|
+
else {
|
|
22378
|
+
if (isNullOrUndefined(heightNumeric.value)) {
|
|
22379
|
+
heightNumeric.placeholder = '0 px';
|
|
22380
|
+
aspectRatioHeight.placeholder = '0 px';
|
|
22381
|
+
}
|
|
22382
|
+
else {
|
|
22383
|
+
heightNumeric.value = 0;
|
|
22384
|
+
aspectRatioHeight.value = '0 px';
|
|
22385
|
+
}
|
|
22386
|
+
}
|
|
22260
22387
|
}
|
|
22261
22388
|
};
|
|
22262
22389
|
ToolbarModule.prototype.getResizeToolbarItem = function () {
|
|
22263
22390
|
var toolbarItems = [];
|
|
22391
|
+
var isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
|
|
22264
22392
|
var spanWidth = document.createElement('span');
|
|
22265
22393
|
spanWidth.innerHTML = this.l10n.getConstant('W');
|
|
22266
22394
|
toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
|
|
22267
22395
|
toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
|
|
22268
22396
|
tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
|
|
22269
|
-
showSpinButton: false, value:
|
|
22270
|
-
format: '###.## px' })
|
|
22397
|
+
showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
|
|
22398
|
+
placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
|
|
22271
22399
|
});
|
|
22272
22400
|
var spanHeight = document.createElement('span');
|
|
22273
22401
|
spanHeight.innerHTML = this.l10n.getConstant('H');
|
|
22274
22402
|
toolbarItems.push({ id: this.parent.element.id + '_height', cssClass: 'e-ie-resize-height', template: spanHeight, align: 'Center' });
|
|
22275
22403
|
toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
|
|
22276
22404
|
tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
|
|
22277
|
-
showSpinButton: false, value:
|
|
22278
|
-
format: '###.## px' })
|
|
22405
|
+
showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
|
|
22406
|
+
placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
|
|
22279
22407
|
});
|
|
22280
22408
|
if (!this.isAspectRatio) {
|
|
22281
22409
|
toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });
|
|
@@ -22345,14 +22473,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
22345
22473
|
var parent = this.parent;
|
|
22346
22474
|
var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
22347
22475
|
var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
22352
|
-
|
|
22353
|
-
if (!isNullOrUndefined(aspectRatioWidth)) {
|
|
22354
|
-
aspectRatioHeight.addEventListener('keyup', this.widthAspectRatio.bind(this));
|
|
22355
|
-
}
|
|
22476
|
+
if (!isNullOrUndefined(aspectRatioHeight)) {
|
|
22477
|
+
aspectRatioWidth.addEventListener('keyup', this.heightAspectRatio.bind(this));
|
|
22478
|
+
}
|
|
22479
|
+
if (!isNullOrUndefined(aspectRatioWidth)) {
|
|
22480
|
+
aspectRatioHeight.addEventListener('keyup', this.widthAspectRatio.bind(this));
|
|
22356
22481
|
}
|
|
22357
22482
|
};
|
|
22358
22483
|
ToolbarModule.prototype.enableDisableTbrBtn = function () {
|
|
@@ -24949,6 +25074,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
24949
25074
|
ToolbarModule.prototype.performDefTbrClick = function (type, isContextualToolbar, isDisabledAdjustment, isDisabledFilter, isFilterFinetune) {
|
|
24950
25075
|
var parent = this.parent;
|
|
24951
25076
|
var zoomIn = parent.element.querySelector('#' + parent.element.id + '_zoomIn');
|
|
25077
|
+
var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
25078
|
+
var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
24952
25079
|
var isCropSelection = false;
|
|
24953
25080
|
var panBtn;
|
|
24954
25081
|
var splitWords;
|
|
@@ -25028,12 +25155,27 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25028
25155
|
case 'aspectratio':
|
|
25029
25156
|
if (!parent.isCircleCrop && (isNullOrUndefined(parent.currSelectionPoint)) ||
|
|
25030
25157
|
(parent.currSelectionPoint && parent.currSelectionPoint.shape !== 'crop-circle')) {
|
|
25158
|
+
if (getComponent(aspectRatioWidth, 'numerictextbox').value) {
|
|
25159
|
+
parent.aspectWidth = getComponent(aspectRatioWidth, 'numerictextbox').value;
|
|
25160
|
+
parent.aspectHeight = getComponent(aspectRatioHeight, 'numerictextbox').value;
|
|
25161
|
+
parent.notify('transform', { prop: 'resize', value: { width: parent.aspectWidth, height: null, isAspectRatio: true } });
|
|
25162
|
+
}
|
|
25031
25163
|
parent.resizeSrc = { startX: parent.img.srcLeft, startY: parent.img.srcTop, width: parent.img.srcWidth,
|
|
25032
25164
|
height: parent.img.srcHeight };
|
|
25033
25165
|
this.refreshToolbar('resize');
|
|
25034
25166
|
}
|
|
25035
25167
|
break;
|
|
25036
25168
|
case 'nonaspectratio':
|
|
25169
|
+
if (getComponent(aspectRatioWidth, 'numerictextbox').value ||
|
|
25170
|
+
getComponent(aspectRatioHeight, 'numerictextbox').value) {
|
|
25171
|
+
parent.aspectWidth = getComponent(aspectRatioWidth, 'numerictextbox').value ?
|
|
25172
|
+
getComponent(aspectRatioWidth, 'numerictextbox').value :
|
|
25173
|
+
parseFloat(getComponent(aspectRatioWidth, 'numerictextbox').placeholder);
|
|
25174
|
+
parent.aspectHeight = getComponent(aspectRatioHeight, 'numerictextbox').value ?
|
|
25175
|
+
getComponent(aspectRatioHeight, 'numerictextbox').value :
|
|
25176
|
+
parseFloat(getComponent(aspectRatioHeight, 'numerictextbox').placeholder);
|
|
25177
|
+
parent.notify('transform', { prop: 'resize', value: { width: parent.aspectWidth, height: parent.aspectHeight, isAspectRatio: false } });
|
|
25178
|
+
}
|
|
25037
25179
|
parent.resizeSrc = { startX: parent.img.srcLeft, startY: parent.img.srcTop, width: parent.img.srcWidth,
|
|
25038
25180
|
height: parent.img.srcHeight };
|
|
25039
25181
|
this.refreshToolbar('resize');
|