@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.
Files changed (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/ej2-image-editor.umd.min.js +2 -2
  3. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-image-editor.es2015.js +330 -163
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +328 -161
  7. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  8. package/dist/global/ej2-image-editor.min.js +2 -2
  9. package/dist/global/ej2-image-editor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +11 -11
  12. package/src/image-editor/action/draw.js +177 -133
  13. package/src/image-editor/action/selection.js +37 -1
  14. package/src/image-editor/action/shape.d.ts +1 -0
  15. package/src/image-editor/action/shape.js +14 -0
  16. package/src/image-editor/action/transform.d.ts +1 -0
  17. package/src/image-editor/action/transform.js +29 -1
  18. package/src/image-editor/base/image-editor.js +3 -1
  19. package/src/image-editor/renderer/toolbar.js +69 -26
  20. package/styles/bootstrap-dark.css +14 -3
  21. package/styles/bootstrap.css +14 -3
  22. package/styles/bootstrap4.css +14 -3
  23. package/styles/bootstrap5-dark.css +14 -3
  24. package/styles/bootstrap5.css +14 -3
  25. package/styles/fabric-dark.css +14 -3
  26. package/styles/fabric.css +14 -3
  27. package/styles/fluent-dark.css +14 -3
  28. package/styles/fluent.css +14 -3
  29. package/styles/highcontrast-light.css +14 -3
  30. package/styles/highcontrast.css +14 -3
  31. package/styles/image-editor/_bootstrap-dark-definition.scss +4 -0
  32. package/styles/image-editor/_bootstrap-definition.scss +4 -0
  33. package/styles/image-editor/_bootstrap4-definition.scss +4 -0
  34. package/styles/image-editor/_bootstrap5-definition.scss +4 -0
  35. package/styles/image-editor/_fabric-dark-definition.scss +4 -0
  36. package/styles/image-editor/_fabric-definition.scss +4 -0
  37. package/styles/image-editor/_fluent-definition.scss +4 -0
  38. package/styles/image-editor/_fusionnew-definition.scss +4 -0
  39. package/styles/image-editor/_highcontrast-definition.scss +4 -0
  40. package/styles/image-editor/_highcontrast-light-definition.scss +4 -0
  41. package/styles/image-editor/_layout.scss +21 -7
  42. package/styles/image-editor/_material-dark-definition.scss +4 -0
  43. package/styles/image-editor/_material-definition.scss +4 -0
  44. package/styles/image-editor/_material3-definition.scss +4 -0
  45. package/styles/image-editor/_tailwind-definition.scss +4 -0
  46. package/styles/image-editor/bootstrap-dark.css +14 -3
  47. package/styles/image-editor/bootstrap.css +14 -3
  48. package/styles/image-editor/bootstrap4.css +14 -3
  49. package/styles/image-editor/bootstrap5-dark.css +14 -3
  50. package/styles/image-editor/bootstrap5.css +14 -3
  51. package/styles/image-editor/fabric-dark.css +14 -3
  52. package/styles/image-editor/fabric.css +14 -3
  53. package/styles/image-editor/fluent-dark.css +14 -3
  54. package/styles/image-editor/fluent.css +14 -3
  55. package/styles/image-editor/highcontrast-light.css +14 -3
  56. package/styles/image-editor/highcontrast.css +14 -3
  57. package/styles/image-editor/material-dark.css +14 -3
  58. package/styles/image-editor/material.css +14 -3
  59. package/styles/image-editor/material3-dark.css +19 -4
  60. package/styles/image-editor/material3.css +19 -4
  61. package/styles/image-editor/tailwind-dark.css +14 -3
  62. package/styles/image-editor/tailwind.css +14 -3
  63. package/styles/material-dark.css +14 -3
  64. package/styles/material.css +14 -3
  65. package/styles/material3-dark.css +19 -4
  66. package/styles/material3.css +19 -4
  67. package/styles/tailwind-dark.css +14 -3
  68. 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 (parent.activeObj.shapeDegree !== parent.transform.degree) {
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
- for (var j = 0, len = parent.activeObj.flipObjColl.length; j < len; j++) {
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
- if (degree % 360 === 0 && (parent.transform.degree !== -360 || parent.transform.currFlipState === '')) {
2646
- canvasDraw.drawImage(parent.activeObj.imageCanvas, imgPoint.startX, imgPoint.startY, imgPoint.width, imgPoint.height);
2647
- }
2648
- else if (degree % 90 === 0 && degree % 180 !== 0) {
2649
- canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
2650
- canvasDraw.rotate(Math.PI / 180 * degree);
2651
- canvasDraw.translate(-parent.lowerCanvas.height / 2, -parent.lowerCanvas.width / 2);
2652
- if (degree % 90 === 0 && degree % 270 !== 0) {
2653
- startY = parent.lowerCanvas.width - (parent.activeObj.activePoint.startX + parent.activeObj.activePoint.width);
2654
- startY += ((parent.activeObj.activePoint.width - imgPoint.height) / 2);
2655
- startX = imgPoint.startY;
2656
- }
2657
- else if (degree % 270 === 0) {
2658
- startX = parent.lowerCanvas.height - (parent.activeObj.activePoint.startY + parent.activeObj.activePoint.height);
2659
- startX += ((parent.activeObj.activePoint.height - imgPoint.width) / 2);
2660
- startY = imgPoint.startX;
2661
- }
2662
- canvasDraw.drawImage(parent.activeObj.imageCanvas, startX, startY, imgPoint.width, imgPoint.height);
2663
- canvasDraw.translate(parent.lowerCanvas.height / 2, parent.lowerCanvas.width / 2);
2664
- canvasDraw.rotate(Math.PI / 180 * -degree);
2665
- canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
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
- else {
2668
- canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
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 actPoint = parent.activeObj.activePoint;
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
- if (degree % 360 === 0 && (parent.transform.degree !== -360 || parent.transform.currFlipState === '')) {
2701
- startX = actPoint.startX + parent.activeObj.textSettings.fontSize * 0.15;
2702
- startY = actPoint.startY + (actPoint.endY - actPoint.startY);
2703
- var rows = parent.activeObj.keyHistory.split('\n');
2704
- for (var i = 0; i < rows.length; i++) {
2705
- startY = actPoint.startY + (i * parent.activeObj.textSettings.fontSize + parent.activeObj.textSettings.fontSize * 0.25);
2706
- canvasDraw.fillText(rows[i], startX, startY);
2707
- }
2708
- }
2709
- else if (degree % 90 === 0 && degree % 180 !== 0) {
2710
- canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
2711
- canvasDraw.rotate(Math.PI / 180 * degree);
2712
- canvasDraw.translate(-parent.lowerCanvas.height / 2, -parent.lowerCanvas.width / 2);
2713
- if (degree % 90 === 0 && degree % 270 !== 0) {
2714
- startY = (parent.lowerCanvas.width - actPoint.endX) +
2715
- parent.activeObj.textSettings.fontSize * 0.4;
2716
- startX = actPoint.startY;
2717
- }
2718
- else if (degree % 270 === 0) {
2719
- startX = parent.lowerCanvas.height - actPoint.endY;
2720
- startY = actPoint.startX + parent.activeObj.textSettings.fontSize * 0.4;
2721
- }
2722
- this.textFlipDegree(canvasDraw, startX, startY);
2723
- canvasDraw.translate(parent.lowerCanvas.height / 2, parent.lowerCanvas.width / 2);
2724
- canvasDraw.rotate(Math.PI / 180 * -degree);
2725
- canvasDraw.translate(-parent.lowerCanvas.width / 2, -parent.lowerCanvas.height / 2);
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
- else {
2728
- canvasDraw.translate(parent.lowerCanvas.width / 2, parent.lowerCanvas.height / 2);
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
- if (!aspectRatioElement) {
3274
- parent.objColl = [];
3275
- parent.pointColl = [];
3276
- parent.freehandCounter = 0;
3277
- parent.cropObj = extend({}, obj1['prevCropObj'], {}, true);
3278
- this.setCurrentObj(obj2['prevObj']);
3279
- parent.objColl = obj2['prevObj']['objColl'];
3280
- parent.pointColl = obj2['prevObj']['pointColl'];
3281
- parent.freehandCounter = parent.pointColl.length;
3282
- parent.notify('shape', { prop: 'zoomObjColl', onPropertyChange: false, value: { isPreventApply: null } });
3283
- parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
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;
@@ -15689,7 +15786,9 @@ var Transform = /** @__PURE__ @class */ (function () {
15689
15786
  var previousZoomFactor = parent.zoomSettings.zoomFactor - (zoomFactor * 10);
15690
15787
  var zoomEventArgs = { zoomPoint: zoomPoint, cancel: false, previousZoomFactor: previousZoomFactor,
15691
15788
  currentZoomFactor: parent.zoomSettings.zoomFactor, zoomTrigger: obj['zoomType'] };
15692
- if (!parent.isCropToolbar && isBlazor() && parent.events && parent.events.zooming.hasDelegate === true) {
15789
+ if (isBlazor() && !parent.isCropToolbar && parent.currentToolbar !== 'resize-toolbar' && parent.currentToolbar !== 'frame-toolbar'
15790
+ && parent.events && parent.events.zooming.hasDelegate === true) {
15791
+ zoomEventArgs.zoomTrigger = parseInt(this.getZoomTriggerType(zoomEventArgs.zoomTrigger));
15693
15792
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
15694
15793
  parent.dotNetRef.invokeMethodAsync('ZoomEventAsync', 'OnZoom', zoomEventArgs).then(function (args) {
15695
15794
  _this.zoomEvent(args, zoomFactor);
@@ -15703,6 +15802,18 @@ var Transform = /** @__PURE__ @class */ (function () {
15703
15802
  }
15704
15803
  }
15705
15804
  };
15805
+ Transform.prototype.getZoomTriggerType = function (type) {
15806
+ switch (type) {
15807
+ case 'MouseWheel':
15808
+ return '1';
15809
+ case 'Pinch':
15810
+ return '2';
15811
+ case 'Commands':
15812
+ return '4';
15813
+ default:
15814
+ return '8';
15815
+ }
15816
+ };
15706
15817
  Transform.prototype.zoomEvent = function (zoomEventArgs, zoomFactor) {
15707
15818
  var parent = this.parent;
15708
15819
  if (zoomEventArgs.cancel) {
@@ -17184,7 +17295,9 @@ var Transform = /** @__PURE__ @class */ (function () {
17184
17295
  Transform.prototype.resizeEventHandler = function (args) {
17185
17296
  var parent = this.parent;
17186
17297
  var isRotate;
17298
+ var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
17187
17299
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
17300
+ var widthElem = parent.element.querySelector(".e-ie-toolbar-e-resize-width-input .e-numerictextbox");
17188
17301
  var heightElem = parent.element.querySelector(".e-ie-toolbar-e-resize-height-input .e-numerictextbox");
17189
17302
  if (args.isAspectRatio) {
17190
17303
  if (this.resizedImgAngle == null || this.resizedImgAngle !== parent.transform.degree) {
@@ -17197,10 +17310,19 @@ var Transform = /** @__PURE__ @class */ (function () {
17197
17310
  getComponent(aspectRatioHeight, 'numerictextbox').value = Math.floor(parent.img.destHeight);
17198
17311
  aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
17199
17312
  parent.aspectHeight = Math.floor(parent.img.destHeight);
17313
+ if (aspectRatioWidth && aspectRatioWidth.value === '') {
17314
+ getComponent(aspectRatioWidth, 'numerictextbox').value = Math.floor(parent.img.destWidth);
17315
+ aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
17316
+ parent.aspectWidth = Math.floor(parent.img.destWidth);
17317
+ }
17200
17318
  }
17201
17319
  else if (heightElem) {
17202
17320
  heightElem.value = Math.floor(parent.img.destHeight).toString();
17203
17321
  parent.aspectHeight = Math.floor(parent.img.destHeight);
17322
+ if (widthElem && widthElem.value === '') {
17323
+ widthElem.value = Math.floor(parent.img.destWidth).toString();
17324
+ parent.aspectWidth = Math.floor(parent.img.destWidth);
17325
+ }
17204
17326
  }
17205
17327
  }
17206
17328
  else {
@@ -19158,6 +19280,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
19158
19280
  this.afterCropActions = [];
19159
19281
  this.currentFilter = '';
19160
19282
  this.tempFrameZoomLevel = null;
19283
+ this.cxtTbarHeight = null;
19161
19284
  var obj_1 = { initialZoomValue: false };
19162
19285
  this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
19163
19286
  if (obj_1['initialZoomValue']) {
@@ -19805,7 +19928,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
19805
19928
  value = 'vertical';
19806
19929
  }
19807
19930
  for (var i = 0; i < this.objColl.length; i++) {
19808
- if (this.objColl[i].shape === 'image') {
19931
+ var shape = this.objColl[i].shape;
19932
+ if (shape === 'image' || shape === 'text') {
19809
19933
  if (isNullOrUndefined(this.objColl[i].rotateFlipColl)) {
19810
19934
  this.objColl[i].rotateFlipColl = [];
19811
19935
  }
@@ -22224,19 +22348,32 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22224
22348
  var parent = this.parent;
22225
22349
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
22226
22350
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
22227
- var aspectRatioIcon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
22351
+ var icon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
22228
22352
  var originalWidth = parent.img.destWidth;
22229
22353
  var originalHeight = parent.img.destHeight;
22230
22354
  var aspectRatioHeightValue = parseFloat(aspectRatioHeight.value);
22231
22355
  var width = Math.floor((aspectRatioHeightValue / (originalHeight / originalWidth)));
22232
- if (aspectRatioIcon) {
22356
+ var widthNumeric = getComponent(aspectRatioWidth, 'numerictextbox');
22357
+ if (icon) {
22233
22358
  if (width != null && !isNaN(width)) {
22234
- getComponent(aspectRatioWidth, 'numerictextbox').value = width;
22235
- aspectRatioWidth.value = width.toString() + ' px';
22359
+ if (isNullOrUndefined(widthNumeric.value)) {
22360
+ widthNumeric.placeholder = width + ' px';
22361
+ aspectRatioWidth.placeholder = width.toString() + ' px';
22362
+ }
22363
+ else {
22364
+ widthNumeric.value = width;
22365
+ aspectRatioWidth.value = width.toString() + ' px';
22366
+ }
22236
22367
  }
22237
22368
  else {
22238
- getComponent(aspectRatioWidth, 'numerictextbox').value = 0;
22239
- aspectRatioWidth.value = '0 px';
22369
+ if (isNullOrUndefined(widthNumeric.value)) {
22370
+ widthNumeric.placeholder = '0 px';
22371
+ aspectRatioWidth.placeholder = '0 px';
22372
+ }
22373
+ else {
22374
+ widthNumeric.value = 0;
22375
+ aspectRatioWidth.value = '0 px';
22376
+ }
22240
22377
  }
22241
22378
  }
22242
22379
  };
@@ -22245,37 +22382,53 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22245
22382
  var parent = this.parent;
22246
22383
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
22247
22384
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
22248
- var aspectRatioIcon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
22385
+ var icon = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
22249
22386
  var originalWidth = parent.img.destWidth;
22250
22387
  var originalHeight = parent.img.destHeight;
22251
22388
  var aspectRatioWidthValue = parseFloat(aspectRatioWidth.value);
22252
22389
  var height = Math.floor((aspectRatioWidthValue / (originalWidth / originalHeight)));
22253
- if (aspectRatioIcon && !isNaN(height)) {
22254
- getComponent(aspectRatioHeight, 'numerictextbox').value = height;
22255
- aspectRatioHeight.value = height.toString() + ' px';
22256
- }
22257
- else {
22258
- getComponent(aspectRatioHeight, 'numerictextbox').value = 0;
22259
- aspectRatioHeight.value = '0 px';
22390
+ var heightNumeric = getComponent(aspectRatioHeight, 'numerictextbox');
22391
+ if (icon) {
22392
+ if (!isNaN(height)) {
22393
+ if (isNullOrUndefined(heightNumeric.value)) {
22394
+ heightNumeric.placeholder = height + ' px';
22395
+ aspectRatioHeight.placeholder = height.toString() + ' px';
22396
+ }
22397
+ else {
22398
+ heightNumeric.value = height;
22399
+ aspectRatioHeight.value = height.toString() + ' px';
22400
+ }
22401
+ }
22402
+ else {
22403
+ if (isNullOrUndefined(heightNumeric.value)) {
22404
+ heightNumeric.placeholder = '0 px';
22405
+ aspectRatioHeight.placeholder = '0 px';
22406
+ }
22407
+ else {
22408
+ heightNumeric.value = 0;
22409
+ aspectRatioHeight.value = '0 px';
22410
+ }
22411
+ }
22260
22412
  }
22261
22413
  };
22262
22414
  ToolbarModule.prototype.getResizeToolbarItem = function () {
22263
22415
  var toolbarItems = [];
22416
+ var isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
22264
22417
  var spanWidth = document.createElement('span');
22265
22418
  spanWidth.innerHTML = this.l10n.getConstant('W');
22266
22419
  toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
22267
22420
  toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
22268
22421
  tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
22269
- showSpinButton: false, value: (this.parent.aspectWidth && this.parent.aspectHeight) ? this.parent.aspectWidth : Math.ceil(this.parent.img.destWidth),
22270
- format: '###.## px' })
22422
+ showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
22423
+ placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
22271
22424
  });
22272
22425
  var spanHeight = document.createElement('span');
22273
22426
  spanHeight.innerHTML = this.l10n.getConstant('H');
22274
22427
  toolbarItems.push({ id: this.parent.element.id + '_height', cssClass: 'e-ie-resize-height', template: spanHeight, align: 'Center' });
22275
22428
  toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
22276
22429
  tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
22277
- showSpinButton: false, value: (this.parent.aspectWidth && this.parent.aspectHeight) ? this.parent.aspectHeight : Math.ceil(this.parent.img.destHeight),
22278
- format: '###.## px' })
22430
+ showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
22431
+ placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
22279
22432
  });
22280
22433
  if (!this.isAspectRatio) {
22281
22434
  toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });
@@ -22345,14 +22498,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22345
22498
  var parent = this.parent;
22346
22499
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
22347
22500
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
22348
- var aspectRatio = parent.element.querySelector('#' + parent.element.id + '_aspectratio');
22349
- if (aspectRatio) {
22350
- if (!isNullOrUndefined(aspectRatioHeight)) {
22351
- aspectRatioWidth.addEventListener('keyup', this.heightAspectRatio.bind(this));
22352
- }
22353
- if (!isNullOrUndefined(aspectRatioWidth)) {
22354
- aspectRatioHeight.addEventListener('keyup', this.widthAspectRatio.bind(this));
22355
- }
22501
+ if (!isNullOrUndefined(aspectRatioHeight)) {
22502
+ aspectRatioWidth.addEventListener('keyup', this.heightAspectRatio.bind(this));
22503
+ }
22504
+ if (!isNullOrUndefined(aspectRatioWidth)) {
22505
+ aspectRatioHeight.addEventListener('keyup', this.widthAspectRatio.bind(this));
22356
22506
  }
22357
22507
  };
22358
22508
  ToolbarModule.prototype.enableDisableTbrBtn = function () {
@@ -24949,6 +25099,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
24949
25099
  ToolbarModule.prototype.performDefTbrClick = function (type, isContextualToolbar, isDisabledAdjustment, isDisabledFilter, isFilterFinetune) {
24950
25100
  var parent = this.parent;
24951
25101
  var zoomIn = parent.element.querySelector('#' + parent.element.id + '_zoomIn');
25102
+ var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
25103
+ var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
24952
25104
  var isCropSelection = false;
24953
25105
  var panBtn;
24954
25106
  var splitWords;
@@ -25028,12 +25180,27 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
25028
25180
  case 'aspectratio':
25029
25181
  if (!parent.isCircleCrop && (isNullOrUndefined(parent.currSelectionPoint)) ||
25030
25182
  (parent.currSelectionPoint && parent.currSelectionPoint.shape !== 'crop-circle')) {
25183
+ if (getComponent(aspectRatioWidth, 'numerictextbox').value) {
25184
+ parent.aspectWidth = getComponent(aspectRatioWidth, 'numerictextbox').value;
25185
+ parent.aspectHeight = getComponent(aspectRatioHeight, 'numerictextbox').value;
25186
+ parent.notify('transform', { prop: 'resize', value: { width: parent.aspectWidth, height: null, isAspectRatio: true } });
25187
+ }
25031
25188
  parent.resizeSrc = { startX: parent.img.srcLeft, startY: parent.img.srcTop, width: parent.img.srcWidth,
25032
25189
  height: parent.img.srcHeight };
25033
25190
  this.refreshToolbar('resize');
25034
25191
  }
25035
25192
  break;
25036
25193
  case 'nonaspectratio':
25194
+ if (getComponent(aspectRatioWidth, 'numerictextbox').value ||
25195
+ getComponent(aspectRatioHeight, 'numerictextbox').value) {
25196
+ parent.aspectWidth = getComponent(aspectRatioWidth, 'numerictextbox').value ?
25197
+ getComponent(aspectRatioWidth, 'numerictextbox').value :
25198
+ parseFloat(getComponent(aspectRatioWidth, 'numerictextbox').placeholder);
25199
+ parent.aspectHeight = getComponent(aspectRatioHeight, 'numerictextbox').value ?
25200
+ getComponent(aspectRatioHeight, 'numerictextbox').value :
25201
+ parseFloat(getComponent(aspectRatioHeight, 'numerictextbox').placeholder);
25202
+ parent.notify('transform', { prop: 'resize', value: { width: parent.aspectWidth, height: parent.aspectHeight, isAspectRatio: false } });
25203
+ }
25037
25204
  parent.resizeSrc = { startX: parent.img.srcLeft, startY: parent.img.srcTop, width: parent.img.srcWidth,
25038
25205
  height: parent.img.srcHeight };
25039
25206
  this.refreshToolbar('resize');