@syncfusion/ej2-image-editor 23.1.43 → 23.2.5
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 +8 -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 +330 -163
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +328 -161
- 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.d.ts +1 -0
- package/src/image-editor/action/transform.js +29 -1
- 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
|
@@ -2448,6 +2448,7 @@ class Draw {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
shapeImage(canvasDraw) {
|
|
2450
2450
|
const parent = this.parent;
|
|
2451
|
+
const actObj = extend({}, parent.activeObj);
|
|
2451
2452
|
const ctx = parent.activeObj.imageCanvas.getContext('2d');
|
|
2452
2453
|
if (canvasDraw === this.lowerContext && this.isImageApply) {
|
|
2453
2454
|
let dimObj = { width: 0, height: 0 };
|
|
@@ -2470,41 +2471,17 @@ class Draw {
|
|
|
2470
2471
|
parent.activeObj.flipObjColl = [];
|
|
2471
2472
|
parent.activeObj.shapeFlip = '';
|
|
2472
2473
|
}
|
|
2473
|
-
for (let j = 0, len = parent.activeObj.flipObjColl.length; j < len; j++) {
|
|
2474
|
-
if (parent.activeObj.flipObjColl[j].toLowerCase() === 'horizontal') {
|
|
2475
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2476
|
-
canvasDraw.scale(-1, 1);
|
|
2477
|
-
parent.activeObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2478
|
-
}
|
|
2479
|
-
else if (parent.activeObj.flipObjColl[j].toLowerCase() === 'vertical') {
|
|
2480
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2481
|
-
canvasDraw.scale(1, -1);
|
|
2482
|
-
parent.activeObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
2474
|
imgPoint.startX = ((parent.activeObj.activePoint.width - imgPoint.width) / 2) + parent.activeObj.activePoint.startX;
|
|
2486
2475
|
imgPoint.startY = ((parent.activeObj.activePoint.height - imgPoint.height) / 2) + parent.activeObj.activePoint.startY;
|
|
2487
2476
|
const temp = canvasDraw.globalAlpha;
|
|
2488
2477
|
canvasDraw.globalAlpha = parent.activeObj.imageTransparency;
|
|
2489
|
-
if (
|
|
2478
|
+
if (actObj.rotateFlipColl && actObj.rotateFlipColl.length > 0) {
|
|
2490
2479
|
this.rotateImage(canvasDraw);
|
|
2491
2480
|
}
|
|
2492
2481
|
else {
|
|
2493
2482
|
canvasDraw.drawImage(parent.activeObj.imageCanvas, imgPoint.startX, imgPoint.startY, imgPoint.width, imgPoint.height);
|
|
2494
2483
|
}
|
|
2495
2484
|
canvasDraw.globalAlpha = temp;
|
|
2496
|
-
for (let k = 0, len = parent.activeObj.flipObjColl.length; k < len; k++) {
|
|
2497
|
-
if (parent.activeObj.flipObjColl[k].toLowerCase() === 'horizontal') {
|
|
2498
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2499
|
-
canvasDraw.scale(-1, 1);
|
|
2500
|
-
parent.activeObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2501
|
-
}
|
|
2502
|
-
else if (parent.activeObj.flipObjColl[k].toLowerCase() === 'vertical') {
|
|
2503
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2504
|
-
canvasDraw.scale(1, -1);
|
|
2505
|
-
parent.activeObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
2485
|
parent.currObjType.isText = false;
|
|
2509
2486
|
}
|
|
2510
2487
|
shapeText(canvasDraw) {
|
|
@@ -2512,6 +2489,7 @@ class Draw {
|
|
|
2512
2489
|
canvasDraw.filter = 'none';
|
|
2513
2490
|
const parent = this.parent;
|
|
2514
2491
|
let actPoint = parent.activeObj.activePoint;
|
|
2492
|
+
const actObj = extend({}, parent.activeObj);
|
|
2515
2493
|
const rows = parent.activeObj.keyHistory.split('\n');
|
|
2516
2494
|
const height = parent.activeObj.textSettings.fontSize + parent.activeObj.textSettings.fontSize * 0.25;
|
|
2517
2495
|
const lineHeight = ((height * rows.length) - (parent.activeObj.textSettings.fontSize * rows.length)) / rows.length;
|
|
@@ -2551,36 +2529,12 @@ class Draw {
|
|
|
2551
2529
|
parent.activeObj.flipObjColl = [];
|
|
2552
2530
|
parent.activeObj.shapeFlip = '';
|
|
2553
2531
|
}
|
|
2554
|
-
|
|
2555
|
-
if (parent.activeObj.flipObjColl[j].toLowerCase() === 'horizontal') {
|
|
2556
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2557
|
-
canvasDraw.scale(-1, 1);
|
|
2558
|
-
actPoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2559
|
-
}
|
|
2560
|
-
else if (parent.activeObj.flipObjColl[j].toLowerCase() === 'vertical') {
|
|
2561
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2562
|
-
canvasDraw.scale(1, -1);
|
|
2563
|
-
actPoint = this.updateActPoint('vertical', canvasDraw);
|
|
2564
|
-
}
|
|
2565
|
-
}
|
|
2566
|
-
if (parent.activeObj.shapeDegree !== parent.transform.degree) {
|
|
2532
|
+
if (actObj.rotateFlipColl && actObj.rotateFlipColl.length > 0) {
|
|
2567
2533
|
this.rotateText(canvasDraw);
|
|
2568
2534
|
}
|
|
2569
2535
|
else {
|
|
2570
2536
|
canvasDraw.fillText(text, actPoint.startX + parent.activeObj.textSettings.fontSize * 0.1, actPoint.startY + yPoint);
|
|
2571
2537
|
}
|
|
2572
|
-
for (let k = 0, len = parent.activeObj.flipObjColl.length; k < len; k++) {
|
|
2573
|
-
if (parent.activeObj.flipObjColl[k].toLowerCase() === 'horizontal') {
|
|
2574
|
-
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2575
|
-
canvasDraw.scale(-1, 1);
|
|
2576
|
-
actPoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2577
|
-
}
|
|
2578
|
-
else if (parent.activeObj.flipObjColl[k].toLowerCase() === 'vertical') {
|
|
2579
|
-
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2580
|
-
canvasDraw.scale(1, -1);
|
|
2581
|
-
actPoint = this.updateActPoint('vertical', canvasDraw);
|
|
2582
|
-
}
|
|
2583
|
-
}
|
|
2584
2538
|
}
|
|
2585
2539
|
canvasDraw.filter = filter;
|
|
2586
2540
|
parent.currObjType.isText = false;
|
|
@@ -2620,6 +2574,8 @@ class Draw {
|
|
|
2620
2574
|
rotateImage(canvasDraw) {
|
|
2621
2575
|
const parent = this.parent;
|
|
2622
2576
|
let degree;
|
|
2577
|
+
let actObj = parent.activeObj;
|
|
2578
|
+
const tempActiveObj = extend({}, parent.activeObj, null, true);
|
|
2623
2579
|
if (parent.activeObj.shapeDegree === 0) {
|
|
2624
2580
|
degree = parent.transform.degree;
|
|
2625
2581
|
}
|
|
@@ -2640,49 +2596,91 @@ class Draw {
|
|
|
2640
2596
|
imgPoint.startY = parent.activeObj.activePoint.startY;
|
|
2641
2597
|
let startX = imgPoint.startX;
|
|
2642
2598
|
let startY = imgPoint.startY;
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2599
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2600
|
+
let tempDegree;
|
|
2601
|
+
const tempColl = [];
|
|
2602
|
+
canvasDraw.save();
|
|
2603
|
+
for (let i = 0, len = actObj.rotateFlipColl.length; i < len; i++) {
|
|
2604
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2605
|
+
let coll = actObj.rotateFlipColl[i];
|
|
2606
|
+
tempColl.push(coll);
|
|
2607
|
+
if (typeof (coll) === 'number') {
|
|
2608
|
+
if (actObj.shapeDegree === 0) {
|
|
2609
|
+
tempDegree = coll;
|
|
2610
|
+
}
|
|
2611
|
+
else {
|
|
2612
|
+
tempDegree = coll - actObj.shapeDegree;
|
|
2613
|
+
}
|
|
2614
|
+
if (tempDegree === -450) {
|
|
2615
|
+
tempDegree = -90;
|
|
2616
|
+
}
|
|
2617
|
+
if (tempDegree < 0) {
|
|
2618
|
+
tempDegree = 360 + tempDegree;
|
|
2619
|
+
}
|
|
2620
|
+
imgPoint.width = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.height : actObj.activePoint.width;
|
|
2621
|
+
imgPoint.height = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.width :
|
|
2622
|
+
actObj.activePoint.height;
|
|
2623
|
+
canvasDraw.translate(canvasDraw.canvas.width / 2, canvasDraw.canvas.height / 2);
|
|
2624
|
+
canvasDraw.rotate(Math.PI / 180 * coll);
|
|
2625
|
+
canvasDraw.translate(-canvasDraw.canvas.height / 2, -canvasDraw.canvas.width / 2);
|
|
2626
|
+
if (tempDegree % 90 === 0 && tempDegree % 270 !== 0) {
|
|
2627
|
+
startY = canvasDraw.canvas.width - (actObj.activePoint.startX + actObj.activePoint.width);
|
|
2628
|
+
startY += ((actObj.activePoint.width - imgPoint.height) / 2);
|
|
2629
|
+
startX = imgPoint.startY;
|
|
2630
|
+
}
|
|
2631
|
+
else if (tempDegree % 270 === 0) {
|
|
2632
|
+
startX = canvasDraw.canvas.height - (actObj.activePoint.startY + actObj.activePoint.height);
|
|
2633
|
+
startX += ((actObj.activePoint.height - imgPoint.width) / 2);
|
|
2634
|
+
startY = imgPoint.startX;
|
|
2635
|
+
}
|
|
2636
|
+
imgPoint.startX = startX;
|
|
2637
|
+
imgPoint.startY = startY;
|
|
2638
|
+
actObj.activePoint.startX = startX;
|
|
2639
|
+
actObj.activePoint.startY = startY;
|
|
2640
|
+
actObj.activePoint.endX = actObj.activePoint.startX + imgPoint.width;
|
|
2641
|
+
actObj.activePoint.endY = actObj.activePoint.startY + imgPoint.height;
|
|
2642
|
+
actObj = this.updateWidthHeight(actObj);
|
|
2643
|
+
}
|
|
2644
|
+
else {
|
|
2645
|
+
if (coll === 'horizontal' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2646
|
+
coll = 'vertical';
|
|
2647
|
+
}
|
|
2648
|
+
else if (coll === 'vertical' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2649
|
+
coll = 'horizontal';
|
|
2650
|
+
}
|
|
2651
|
+
if (coll === 'horizontal') {
|
|
2652
|
+
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2653
|
+
canvasDraw.scale(-1, 1);
|
|
2654
|
+
actObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2655
|
+
}
|
|
2656
|
+
else if (coll === 'vertical') {
|
|
2657
|
+
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2658
|
+
canvasDraw.scale(1, -1);
|
|
2659
|
+
actObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2660
|
+
}
|
|
2661
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2662
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2663
|
+
}
|
|
2664
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2665
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2666
|
+
startX = imgPoint.startX;
|
|
2667
|
+
startY = imgPoint.startY;
|
|
2664
2668
|
}
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
canvasDraw.rotate(Math.PI / 180 * degree);
|
|
2668
|
-
startX = parent.lowerCanvas.width - (imgPoint.startX + imgPoint.width);
|
|
2669
|
-
startY = parent.lowerCanvas.height - (imgPoint.startY + imgPoint.height);
|
|
2670
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2671
|
-
canvasDraw.drawImage(parent.activeObj.imageCanvas, startX, startY, imgPoint.width, imgPoint.height);
|
|
2672
|
-
canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
|
|
2673
|
-
canvasDraw.rotate(Math.PI / 180 * -degree);
|
|
2674
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2669
|
+
if (actObj.rotatedAngle !== 0) {
|
|
2670
|
+
parent.notify('shape', { prop: 'setPointCollForShapeRotation', onPropertyChange: false, value: { obj: actObj } });
|
|
2675
2671
|
}
|
|
2672
|
+
canvasDraw.drawImage(actObj.imageCanvas, imgPoint.startX, imgPoint.startY, imgPoint.width, imgPoint.height);
|
|
2673
|
+
canvasDraw.restore();
|
|
2674
|
+
parent.activeObj = tempActiveObj;
|
|
2676
2675
|
if (parent.transform.degree === 360 || parent.transform.degree === -360) {
|
|
2677
2676
|
parent.transform.degree = 0;
|
|
2678
2677
|
}
|
|
2679
2678
|
}
|
|
2680
2679
|
rotateText(canvasDraw) {
|
|
2681
2680
|
const parent = this.parent;
|
|
2682
|
-
let startX = parent.activeObj.activePoint.startX;
|
|
2683
|
-
let startY = parent.activeObj.activePoint.startY;
|
|
2684
2681
|
let degree;
|
|
2685
|
-
|
|
2682
|
+
let actObj = parent.activeObj;
|
|
2683
|
+
const tempActiveObj = extend({}, parent.activeObj, null, true);
|
|
2686
2684
|
if (parent.activeObj.shapeDegree === 0) {
|
|
2687
2685
|
degree = parent.transform.degree;
|
|
2688
2686
|
}
|
|
@@ -2695,45 +2693,89 @@ class Draw {
|
|
|
2695
2693
|
if (degree < 0) {
|
|
2696
2694
|
degree = 360 + degree;
|
|
2697
2695
|
}
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2696
|
+
const imgPoint = { startX: 0, startY: 0, width: 0, height: 0 };
|
|
2697
|
+
imgPoint.width = degree % 90 === 0 && degree % 180 !== 0 ? actObj.activePoint.height : actObj.activePoint.width;
|
|
2698
|
+
imgPoint.height = degree % 90 === 0 && degree % 180 !== 0 ? actObj.activePoint.width :
|
|
2699
|
+
actObj.activePoint.height;
|
|
2700
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2701
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2702
|
+
let startX = imgPoint.startX;
|
|
2703
|
+
let startY = imgPoint.startY;
|
|
2704
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2705
|
+
let tempDegree;
|
|
2706
|
+
const tempColl = [];
|
|
2707
|
+
canvasDraw.save();
|
|
2708
|
+
for (let i = 0, len = actObj.rotateFlipColl.length; i < len; i++) {
|
|
2709
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
2710
|
+
let coll = actObj.rotateFlipColl[i];
|
|
2711
|
+
tempColl.push(coll);
|
|
2712
|
+
if (typeof (coll) === 'number') {
|
|
2713
|
+
if (actObj.shapeDegree === 0) {
|
|
2714
|
+
tempDegree = coll;
|
|
2715
|
+
}
|
|
2716
|
+
else {
|
|
2717
|
+
tempDegree = coll - actObj.shapeDegree;
|
|
2718
|
+
}
|
|
2719
|
+
if (tempDegree === -450) {
|
|
2720
|
+
tempDegree = -90;
|
|
2721
|
+
}
|
|
2722
|
+
if (tempDegree < 0) {
|
|
2723
|
+
tempDegree = 360 + tempDegree;
|
|
2724
|
+
}
|
|
2725
|
+
imgPoint.width = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.height : actObj.activePoint.width;
|
|
2726
|
+
imgPoint.height = tempDegree % 90 === 0 && tempDegree % 180 !== 0 ? actObj.activePoint.width :
|
|
2727
|
+
actObj.activePoint.height;
|
|
2728
|
+
canvasDraw.translate(canvasDraw.canvas.width / 2, canvasDraw.canvas.height / 2);
|
|
2729
|
+
canvasDraw.rotate(Math.PI / 180 * coll);
|
|
2730
|
+
canvasDraw.translate(-canvasDraw.canvas.height / 2, -canvasDraw.canvas.width / 2);
|
|
2731
|
+
if (tempDegree % 90 === 0 && tempDegree % 270 !== 0) {
|
|
2732
|
+
startY = (parent.lowerCanvas.width - actObj.activePoint.endX);
|
|
2733
|
+
startX = actObj.activePoint.startY;
|
|
2734
|
+
}
|
|
2735
|
+
else if (tempDegree % 270 === 0) {
|
|
2736
|
+
startX = parent.lowerCanvas.height - actObj.activePoint.endY;
|
|
2737
|
+
startY = actObj.activePoint.startX;
|
|
2738
|
+
}
|
|
2739
|
+
imgPoint.startX = startX;
|
|
2740
|
+
imgPoint.startY = startY;
|
|
2741
|
+
actObj.activePoint.startX = startX;
|
|
2742
|
+
actObj.activePoint.startY = startY;
|
|
2743
|
+
actObj.activePoint.endX = actObj.activePoint.startX + imgPoint.width;
|
|
2744
|
+
actObj.activePoint.endY = actObj.activePoint.startY + imgPoint.height;
|
|
2745
|
+
actObj = this.updateWidthHeight(actObj);
|
|
2746
|
+
}
|
|
2747
|
+
else {
|
|
2748
|
+
if (coll === 'horizontal' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2749
|
+
coll = 'vertical';
|
|
2750
|
+
}
|
|
2751
|
+
else if (coll === 'vertical' && degree % 90 === 0 && degree % 180 !== 0) {
|
|
2752
|
+
coll = 'horizontal';
|
|
2753
|
+
}
|
|
2754
|
+
if (coll === 'horizontal') {
|
|
2755
|
+
canvasDraw.translate(canvasDraw.canvas.width, 0);
|
|
2756
|
+
canvasDraw.scale(-1, 1);
|
|
2757
|
+
actObj.activePoint = this.updateActPoint('horizontal', canvasDraw);
|
|
2758
|
+
}
|
|
2759
|
+
else if (coll === 'vertical') {
|
|
2760
|
+
canvasDraw.translate(0, canvasDraw.canvas.height);
|
|
2761
|
+
canvasDraw.scale(1, -1);
|
|
2762
|
+
actObj.activePoint = this.updateActPoint('vertical', canvasDraw);
|
|
2763
|
+
}
|
|
2764
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2765
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2766
|
+
}
|
|
2767
|
+
imgPoint.startX = actObj.activePoint.startX;
|
|
2768
|
+
imgPoint.startY = actObj.activePoint.startY;
|
|
2769
|
+
startX = imgPoint.startX;
|
|
2770
|
+
startY = imgPoint.startY;
|
|
2724
2771
|
}
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
canvasDraw.rotate(Math.PI / 180 * degree);
|
|
2728
|
-
startX = parent.lowerCanvas.width - actPoint.endX;
|
|
2729
|
-
startY = (parent.lowerCanvas.height - actPoint.endY) +
|
|
2730
|
-
parent.activeObj.textSettings.fontSize * 0.4;
|
|
2731
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2732
|
-
this.textFlipDegree(canvasDraw, startX, startY);
|
|
2733
|
-
canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
|
|
2734
|
-
canvasDraw.rotate(Math.PI / 180 * -degree);
|
|
2735
|
-
canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
|
|
2772
|
+
if (actObj.rotatedAngle !== 0) {
|
|
2773
|
+
parent.notify('shape', { prop: 'setPointCollForShapeRotation', onPropertyChange: false, value: { obj: actObj } });
|
|
2736
2774
|
}
|
|
2775
|
+
startY += actObj.textSettings.fontSize * 0.4;
|
|
2776
|
+
this.textFlipDegree(canvasDraw, startX, startY);
|
|
2777
|
+
canvasDraw.restore();
|
|
2778
|
+
parent.activeObj = tempActiveObj;
|
|
2737
2779
|
if (parent.transform.degree === 360 || parent.transform.degree === -360) {
|
|
2738
2780
|
parent.transform.degree = 0;
|
|
2739
2781
|
}
|
|
@@ -3267,22 +3309,23 @@ class Draw {
|
|
|
3267
3309
|
this.parent.notify('toolbar', { prop: 'getPrevCropObj', onPropertyChange: false, value: { obj: obj1 } });
|
|
3268
3310
|
this.parent.notify('toolbar', { prop: 'getPrevObj', onPropertyChange: false, value: { obj: obj2 } });
|
|
3269
3311
|
if (obj1['prevCropObj'] && obj2['prevObj']) {
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3312
|
+
parent.objColl = [];
|
|
3313
|
+
parent.pointColl = [];
|
|
3314
|
+
parent.freehandCounter = 0;
|
|
3315
|
+
parent.cropObj = extend({}, obj1['prevCropObj'], {}, true);
|
|
3316
|
+
this.setCurrentObj(obj2['prevObj']);
|
|
3317
|
+
parent.objColl = obj2['prevObj']['objColl'];
|
|
3318
|
+
parent.pointColl = obj2['prevObj']['pointColl'];
|
|
3319
|
+
parent.freehandCounter = parent.pointColl.length;
|
|
3320
|
+
parent.notify('shape', { prop: 'zoomObjColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
3321
|
+
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
3322
|
+
const currObj = parent.currSelectionPoint ?
|
|
3323
|
+
extend({}, parent.currSelectionPoint, {}, true) : null;
|
|
3282
3324
|
this.parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3283
3325
|
value: { zoomFactor: -this.parent.transform.zoomFactor, zoomPoint: null, isResize: true } });
|
|
3284
3326
|
this.parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3285
3327
|
value: { zoomFactor: obj2['prevObj']['defaultZoom'], zoomPoint: null, isResize: true } });
|
|
3328
|
+
parent.currSelectionPoint = currObj;
|
|
3286
3329
|
if (obj2['prevObj'].zoomFactor) {
|
|
3287
3330
|
parent.setProperties({ zoomSettings: { zoomFactor: obj2['prevObj'].zoomFactor } }, true);
|
|
3288
3331
|
}
|
|
@@ -3290,6 +3333,7 @@ class Draw {
|
|
|
3290
3333
|
value: { previousZoomValue: parent.zoomSettings.zoomFactor } });
|
|
3291
3334
|
}
|
|
3292
3335
|
parent.isResize = false;
|
|
3336
|
+
parent.notify('transform', { prop: 'setResizedImgAngle', onPropertyChange: false, value: { angle: null } });
|
|
3293
3337
|
}
|
|
3294
3338
|
}
|
|
3295
3339
|
if (parent.togglePen) {
|
|
@@ -11032,6 +11076,36 @@ class Selection {
|
|
|
11032
11076
|
parent.notify('transform', { prop: 'resize', value: { width: point.x, height: point.y, isAspectRatio: false } });
|
|
11033
11077
|
}
|
|
11034
11078
|
}
|
|
11079
|
+
if (isBlazor()) {
|
|
11080
|
+
const aspectRatioHeight = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
|
|
11081
|
+
const aspectRatioWidth = this.parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-numerictextbox');
|
|
11082
|
+
if ((blrAspRatElem && blrAspRatElem.classList.contains('e-hidden'))) {
|
|
11083
|
+
if (aspectRatioHeight && aspectRatioHeight.value === "") {
|
|
11084
|
+
aspectRatioHeight.value = aspectRatioHeight.placeholder;
|
|
11085
|
+
aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString();
|
|
11086
|
+
}
|
|
11087
|
+
if (aspectRatioWidth && aspectRatioWidth.value === "") {
|
|
11088
|
+
aspectRatioWidth.value = aspectRatioWidth.placeholder;
|
|
11089
|
+
aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString();
|
|
11090
|
+
}
|
|
11091
|
+
}
|
|
11092
|
+
}
|
|
11093
|
+
else {
|
|
11094
|
+
const aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
11095
|
+
const aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
11096
|
+
if (isNullOrUndefined(aspectRatioElement)) {
|
|
11097
|
+
let elem = getComponent(aspectRatioHeight, 'numerictextbox');
|
|
11098
|
+
if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
|
|
11099
|
+
elem.value = parseFloat(elem.placeholder);
|
|
11100
|
+
aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
|
|
11101
|
+
}
|
|
11102
|
+
elem = getComponent(aspectRatioWidth, 'numerictextbox');
|
|
11103
|
+
if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
|
|
11104
|
+
elem.value = parseFloat(elem.placeholder);
|
|
11105
|
+
aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
|
|
11106
|
+
}
|
|
11107
|
+
}
|
|
11108
|
+
}
|
|
11035
11109
|
}
|
|
11036
11110
|
else {
|
|
11037
11111
|
let splitWords;
|
|
@@ -11987,8 +12061,14 @@ class Selection {
|
|
|
11987
12061
|
heightElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
|
|
11988
12062
|
}
|
|
11989
12063
|
if (widthElement && heightElement) {
|
|
11990
|
-
|
|
11991
|
-
|
|
12064
|
+
let heightString = heightElement.value.replace(/,/g, '');
|
|
12065
|
+
let widthString = widthElement.value.replace(/,/g, '');
|
|
12066
|
+
if (heightString === '') {
|
|
12067
|
+
heightString = heightElement.placeholder.replace(/,/g, '');
|
|
12068
|
+
}
|
|
12069
|
+
if (widthString === '') {
|
|
12070
|
+
widthString = widthElement.placeholder.replace(/,/g, '');
|
|
12071
|
+
}
|
|
11992
12072
|
height = parseFloat(heightString);
|
|
11993
12073
|
width = parseFloat(widthString);
|
|
11994
12074
|
}
|
|
@@ -12227,6 +12307,9 @@ class Shape {
|
|
|
12227
12307
|
case 'updateObj':
|
|
12228
12308
|
this.updateObj(args.value['dimObj'], args.value['x'], args.value['y']);
|
|
12229
12309
|
break;
|
|
12310
|
+
case 'updateSelectionChangeEventArgs':
|
|
12311
|
+
this.updateSelectionChangeEventArgs(args.value['selectionSettings']);
|
|
12312
|
+
break;
|
|
12230
12313
|
}
|
|
12231
12314
|
}
|
|
12232
12315
|
getModuleName() {
|
|
@@ -12791,6 +12874,17 @@ class Shape {
|
|
|
12791
12874
|
}
|
|
12792
12875
|
}
|
|
12793
12876
|
}
|
|
12877
|
+
updateSelectionChangeEventArgs(selectionSettings) {
|
|
12878
|
+
const parent = this.parent;
|
|
12879
|
+
parent.activeObj.activePoint.startX = selectionSettings.startX;
|
|
12880
|
+
parent.activeObj.activePoint.startY = selectionSettings.startY;
|
|
12881
|
+
if (selectionSettings.width && selectionSettings.height) {
|
|
12882
|
+
parent.activeObj.activePoint.width = selectionSettings.width;
|
|
12883
|
+
parent.activeObj.activePoint.height = selectionSettings.height;
|
|
12884
|
+
parent.activeObj.activePoint.endX = parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width;
|
|
12885
|
+
parent.activeObj.activePoint.endY = parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height;
|
|
12886
|
+
}
|
|
12887
|
+
}
|
|
12794
12888
|
addLetter(letter) {
|
|
12795
12889
|
const parent = this.parent;
|
|
12796
12890
|
if (parent.textArea.style.display === 'none' && (parent.currObjType.isText || parent.activeObj.shape === 'text')) {
|
|
@@ -15154,6 +15248,9 @@ class Transform {
|
|
|
15154
15248
|
case 'resize':
|
|
15155
15249
|
this.resize(args.value['width'], args.value['height'], args.value['isAspectRatio']);
|
|
15156
15250
|
break;
|
|
15251
|
+
case 'setResizedImgAngle':
|
|
15252
|
+
this.resizedImgAngle = args.value['angle'];
|
|
15253
|
+
break;
|
|
15157
15254
|
case 'reset':
|
|
15158
15255
|
this.reset();
|
|
15159
15256
|
break;
|
|
@@ -15661,7 +15758,9 @@ class Transform {
|
|
|
15661
15758
|
const previousZoomFactor = parent.zoomSettings.zoomFactor - (zoomFactor * 10);
|
|
15662
15759
|
const zoomEventArgs = { zoomPoint: zoomPoint, cancel: false, previousZoomFactor: previousZoomFactor,
|
|
15663
15760
|
currentZoomFactor: parent.zoomSettings.zoomFactor, zoomTrigger: obj['zoomType'] };
|
|
15664
|
-
if (!parent.isCropToolbar &&
|
|
15761
|
+
if (isBlazor() && !parent.isCropToolbar && parent.currentToolbar !== 'resize-toolbar' && parent.currentToolbar !== 'frame-toolbar'
|
|
15762
|
+
&& parent.events && parent.events.zooming.hasDelegate === true) {
|
|
15763
|
+
zoomEventArgs.zoomTrigger = parseInt(this.getZoomTriggerType(zoomEventArgs.zoomTrigger));
|
|
15665
15764
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15666
15765
|
parent.dotNetRef.invokeMethodAsync('ZoomEventAsync', 'OnZoom', zoomEventArgs).then((args) => {
|
|
15667
15766
|
this.zoomEvent(args, zoomFactor);
|
|
@@ -15675,6 +15774,18 @@ class Transform {
|
|
|
15675
15774
|
}
|
|
15676
15775
|
}
|
|
15677
15776
|
}
|
|
15777
|
+
getZoomTriggerType(type) {
|
|
15778
|
+
switch (type) {
|
|
15779
|
+
case 'MouseWheel':
|
|
15780
|
+
return '1';
|
|
15781
|
+
case 'Pinch':
|
|
15782
|
+
return '2';
|
|
15783
|
+
case 'Commands':
|
|
15784
|
+
return '4';
|
|
15785
|
+
default:
|
|
15786
|
+
return '8';
|
|
15787
|
+
}
|
|
15788
|
+
}
|
|
15678
15789
|
zoomEvent(zoomEventArgs, zoomFactor) {
|
|
15679
15790
|
const parent = this.parent;
|
|
15680
15791
|
if (zoomEventArgs.cancel) {
|
|
@@ -17153,7 +17264,9 @@ class Transform {
|
|
|
17153
17264
|
resizeEventHandler(args) {
|
|
17154
17265
|
const parent = this.parent;
|
|
17155
17266
|
let isRotate;
|
|
17267
|
+
const aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
17156
17268
|
const aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
17269
|
+
const widthElem = parent.element.querySelector(".e-ie-toolbar-e-resize-width-input .e-numerictextbox");
|
|
17157
17270
|
const heightElem = parent.element.querySelector(".e-ie-toolbar-e-resize-height-input .e-numerictextbox");
|
|
17158
17271
|
if (args.isAspectRatio) {
|
|
17159
17272
|
if (this.resizedImgAngle == null || this.resizedImgAngle !== parent.transform.degree) {
|
|
@@ -17166,10 +17279,19 @@ class Transform {
|
|
|
17166
17279
|
getComponent(aspectRatioHeight, 'numerictextbox').value = Math.floor(parent.img.destHeight);
|
|
17167
17280
|
aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
|
|
17168
17281
|
parent.aspectHeight = Math.floor(parent.img.destHeight);
|
|
17282
|
+
if (aspectRatioWidth && aspectRatioWidth.value === '') {
|
|
17283
|
+
getComponent(aspectRatioWidth, 'numerictextbox').value = Math.floor(parent.img.destWidth);
|
|
17284
|
+
aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
|
|
17285
|
+
parent.aspectWidth = Math.floor(parent.img.destWidth);
|
|
17286
|
+
}
|
|
17169
17287
|
}
|
|
17170
17288
|
else if (heightElem) {
|
|
17171
17289
|
heightElem.value = Math.floor(parent.img.destHeight).toString();
|
|
17172
17290
|
parent.aspectHeight = Math.floor(parent.img.destHeight);
|
|
17291
|
+
if (widthElem && widthElem.value === '') {
|
|
17292
|
+
widthElem.value = Math.floor(parent.img.destWidth).toString();
|
|
17293
|
+
parent.aspectWidth = Math.floor(parent.img.destWidth);
|
|
17294
|
+
}
|
|
17173
17295
|
}
|
|
17174
17296
|
}
|
|
17175
17297
|
else {
|
|
@@ -19092,6 +19214,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
|
|
|
19092
19214
|
this.afterCropActions = [];
|
|
19093
19215
|
this.currentFilter = '';
|
|
19094
19216
|
this.tempFrameZoomLevel = null;
|
|
19217
|
+
this.cxtTbarHeight = null;
|
|
19095
19218
|
const obj = { initialZoomValue: false };
|
|
19096
19219
|
this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj } });
|
|
19097
19220
|
if (obj['initialZoomValue']) {
|
|
@@ -19739,7 +19862,8 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
|
|
|
19739
19862
|
value = 'vertical';
|
|
19740
19863
|
}
|
|
19741
19864
|
for (let i = 0; i < this.objColl.length; i++) {
|
|
19742
|
-
|
|
19865
|
+
const shape = this.objColl[i].shape;
|
|
19866
|
+
if (shape === 'image' || shape === 'text') {
|
|
19743
19867
|
if (isNullOrUndefined(this.objColl[i].rotateFlipColl)) {
|
|
19744
19868
|
this.objColl[i].rotateFlipColl = [];
|
|
19745
19869
|
}
|
|
@@ -22152,19 +22276,32 @@ class ToolbarModule {
|
|
|
22152
22276
|
const parent = this.parent;
|
|
22153
22277
|
const aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
22154
22278
|
const aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
22155
|
-
const
|
|
22279
|
+
const icon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
|
|
22156
22280
|
const originalWidth = parent.img.destWidth;
|
|
22157
22281
|
const originalHeight = parent.img.destHeight;
|
|
22158
22282
|
const aspectRatioHeightValue = parseFloat(aspectRatioHeight.value);
|
|
22159
22283
|
const width = Math.floor((aspectRatioHeightValue / (originalHeight / originalWidth)));
|
|
22160
|
-
|
|
22284
|
+
const widthNumeric = getComponent(aspectRatioWidth, 'numerictextbox');
|
|
22285
|
+
if (icon) {
|
|
22161
22286
|
if (width != null && !isNaN(width)) {
|
|
22162
|
-
|
|
22163
|
-
|
|
22287
|
+
if (isNullOrUndefined(widthNumeric.value)) {
|
|
22288
|
+
widthNumeric.placeholder = width + ' px';
|
|
22289
|
+
aspectRatioWidth.placeholder = width.toString() + ' px';
|
|
22290
|
+
}
|
|
22291
|
+
else {
|
|
22292
|
+
widthNumeric.value = width;
|
|
22293
|
+
aspectRatioWidth.value = width.toString() + ' px';
|
|
22294
|
+
}
|
|
22164
22295
|
}
|
|
22165
22296
|
else {
|
|
22166
|
-
|
|
22167
|
-
|
|
22297
|
+
if (isNullOrUndefined(widthNumeric.value)) {
|
|
22298
|
+
widthNumeric.placeholder = '0 px';
|
|
22299
|
+
aspectRatioWidth.placeholder = '0 px';
|
|
22300
|
+
}
|
|
22301
|
+
else {
|
|
22302
|
+
widthNumeric.value = 0;
|
|
22303
|
+
aspectRatioWidth.value = '0 px';
|
|
22304
|
+
}
|
|
22168
22305
|
}
|
|
22169
22306
|
}
|
|
22170
22307
|
}
|
|
@@ -22173,37 +22310,53 @@ class ToolbarModule {
|
|
|
22173
22310
|
const parent = this.parent;
|
|
22174
22311
|
const aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
22175
22312
|
const aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
22176
|
-
const
|
|
22313
|
+
const icon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
|
|
22177
22314
|
const originalWidth = parent.img.destWidth;
|
|
22178
22315
|
const originalHeight = parent.img.destHeight;
|
|
22179
22316
|
const aspectRatioWidthValue = parseFloat(aspectRatioWidth.value);
|
|
22180
22317
|
const height = Math.floor((aspectRatioWidthValue / (originalWidth / originalHeight)));
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
|
|
22186
|
-
|
|
22187
|
-
|
|
22318
|
+
const heightNumeric = getComponent(aspectRatioHeight, 'numerictextbox');
|
|
22319
|
+
if (icon) {
|
|
22320
|
+
if (!isNaN(height)) {
|
|
22321
|
+
if (isNullOrUndefined(heightNumeric.value)) {
|
|
22322
|
+
heightNumeric.placeholder = height + ' px';
|
|
22323
|
+
aspectRatioHeight.placeholder = height.toString() + ' px';
|
|
22324
|
+
}
|
|
22325
|
+
else {
|
|
22326
|
+
heightNumeric.value = height;
|
|
22327
|
+
aspectRatioHeight.value = height.toString() + ' px';
|
|
22328
|
+
}
|
|
22329
|
+
}
|
|
22330
|
+
else {
|
|
22331
|
+
if (isNullOrUndefined(heightNumeric.value)) {
|
|
22332
|
+
heightNumeric.placeholder = '0 px';
|
|
22333
|
+
aspectRatioHeight.placeholder = '0 px';
|
|
22334
|
+
}
|
|
22335
|
+
else {
|
|
22336
|
+
heightNumeric.value = 0;
|
|
22337
|
+
aspectRatioHeight.value = '0 px';
|
|
22338
|
+
}
|
|
22339
|
+
}
|
|
22188
22340
|
}
|
|
22189
22341
|
}
|
|
22190
22342
|
getResizeToolbarItem() {
|
|
22191
22343
|
const toolbarItems = [];
|
|
22344
|
+
const isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
|
|
22192
22345
|
const spanWidth = document.createElement('span');
|
|
22193
22346
|
spanWidth.innerHTML = this.l10n.getConstant('W');
|
|
22194
22347
|
toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
|
|
22195
22348
|
toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
|
|
22196
22349
|
tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
|
|
22197
|
-
showSpinButton: false, value:
|
|
22198
|
-
format: '###.## px' })
|
|
22350
|
+
showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
|
|
22351
|
+
placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
|
|
22199
22352
|
});
|
|
22200
22353
|
const spanHeight = document.createElement('span');
|
|
22201
22354
|
spanHeight.innerHTML = this.l10n.getConstant('H');
|
|
22202
22355
|
toolbarItems.push({ id: this.parent.element.id + '_height', cssClass: 'e-ie-resize-height', template: spanHeight, align: 'Center' });
|
|
22203
22356
|
toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
|
|
22204
22357
|
tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
|
|
22205
|
-
showSpinButton: false, value:
|
|
22206
|
-
format: '###.## px' })
|
|
22358
|
+
showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
|
|
22359
|
+
placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
|
|
22207
22360
|
});
|
|
22208
22361
|
if (!this.isAspectRatio) {
|
|
22209
22362
|
toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });
|
|
@@ -22272,14 +22425,11 @@ class ToolbarModule {
|
|
|
22272
22425
|
const parent = this.parent;
|
|
22273
22426
|
const aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
22274
22427
|
const aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
22279
|
-
|
|
22280
|
-
if (!isNullOrUndefined(aspectRatioWidth)) {
|
|
22281
|
-
aspectRatioHeight.addEventListener('keyup', this.widthAspectRatio.bind(this));
|
|
22282
|
-
}
|
|
22428
|
+
if (!isNullOrUndefined(aspectRatioHeight)) {
|
|
22429
|
+
aspectRatioWidth.addEventListener('keyup', this.heightAspectRatio.bind(this));
|
|
22430
|
+
}
|
|
22431
|
+
if (!isNullOrUndefined(aspectRatioWidth)) {
|
|
22432
|
+
aspectRatioHeight.addEventListener('keyup', this.widthAspectRatio.bind(this));
|
|
22283
22433
|
}
|
|
22284
22434
|
}
|
|
22285
22435
|
enableDisableTbrBtn() {
|
|
@@ -24866,6 +25016,8 @@ class ToolbarModule {
|
|
|
24866
25016
|
performDefTbrClick(type, isContextualToolbar, isDisabledAdjustment, isDisabledFilter, isFilterFinetune) {
|
|
24867
25017
|
const parent = this.parent;
|
|
24868
25018
|
const zoomIn = parent.element.querySelector('#' + parent.element.id + '_zoomIn');
|
|
25019
|
+
const aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
|
|
25020
|
+
const aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
|
|
24869
25021
|
let isCropSelection = false;
|
|
24870
25022
|
let panBtn;
|
|
24871
25023
|
let splitWords;
|
|
@@ -24945,12 +25097,27 @@ class ToolbarModule {
|
|
|
24945
25097
|
case 'aspectratio':
|
|
24946
25098
|
if (!parent.isCircleCrop && (isNullOrUndefined(parent.currSelectionPoint)) ||
|
|
24947
25099
|
(parent.currSelectionPoint && parent.currSelectionPoint.shape !== 'crop-circle')) {
|
|
25100
|
+
if (getComponent(aspectRatioWidth, 'numerictextbox').value) {
|
|
25101
|
+
parent.aspectWidth = getComponent(aspectRatioWidth, 'numerictextbox').value;
|
|
25102
|
+
parent.aspectHeight = getComponent(aspectRatioHeight, 'numerictextbox').value;
|
|
25103
|
+
parent.notify('transform', { prop: 'resize', value: { width: parent.aspectWidth, height: null, isAspectRatio: true } });
|
|
25104
|
+
}
|
|
24948
25105
|
parent.resizeSrc = { startX: parent.img.srcLeft, startY: parent.img.srcTop, width: parent.img.srcWidth,
|
|
24949
25106
|
height: parent.img.srcHeight };
|
|
24950
25107
|
this.refreshToolbar('resize');
|
|
24951
25108
|
}
|
|
24952
25109
|
break;
|
|
24953
25110
|
case 'nonaspectratio':
|
|
25111
|
+
if (getComponent(aspectRatioWidth, 'numerictextbox').value ||
|
|
25112
|
+
getComponent(aspectRatioHeight, 'numerictextbox').value) {
|
|
25113
|
+
parent.aspectWidth = getComponent(aspectRatioWidth, 'numerictextbox').value ?
|
|
25114
|
+
getComponent(aspectRatioWidth, 'numerictextbox').value :
|
|
25115
|
+
parseFloat(getComponent(aspectRatioWidth, 'numerictextbox').placeholder);
|
|
25116
|
+
parent.aspectHeight = getComponent(aspectRatioHeight, 'numerictextbox').value ?
|
|
25117
|
+
getComponent(aspectRatioHeight, 'numerictextbox').value :
|
|
25118
|
+
parseFloat(getComponent(aspectRatioHeight, 'numerictextbox').placeholder);
|
|
25119
|
+
parent.notify('transform', { prop: 'resize', value: { width: parent.aspectWidth, height: parent.aspectHeight, isAspectRatio: false } });
|
|
25120
|
+
}
|
|
24954
25121
|
parent.resizeSrc = { startX: parent.img.srcLeft, startY: parent.img.srcTop, width: parent.img.srcWidth,
|
|
24955
25122
|
height: parent.img.srcHeight };
|
|
24956
25123
|
this.refreshToolbar('resize');
|