@syncfusion/ej2-image-editor 27.1.52 → 27.1.53

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.1.52
3
+ * version : 27.1.53
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-image-editor@*",
3
- "_id": "@syncfusion/ej2-image-editor@27.1.51",
3
+ "_id": "@syncfusion/ej2-image-editor@27.1.52",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-D2co3Roz/iOn3T1Ef3sXGpOukufgf2f3UqrUr1mYn4nm42eVAZ/RutRLdRXFBGMQa9NZ3h5p8VwCWpV43HXYGg==",
5
+ "_integrity": "sha512-4y4FiADe4A4Y5hu5mauYQwkHPa+rNYrtX5DFVwWITwzAvinOMwQe9sMg1rMjx3qnpwFDH06C9qR7Qm/kdDgd3Q==",
6
6
  "_location": "/@syncfusion/ej2-image-editor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-image-editor",
24
24
  "/@syncfusion/ej2-vue-image-editor"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-27.1.51.tgz",
27
- "_shasum": "352f528238cdecb1dccbadc4df5f2dd8ccd50f9a",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-27.1.52.tgz",
27
+ "_shasum": "7cd217a052e3fb179ad0f19d492d7df369c8b183",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
30
30
  "author": {
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~27.1.52",
36
- "@syncfusion/ej2-buttons": "~27.1.51",
37
- "@syncfusion/ej2-dropdowns": "~27.1.52",
35
+ "@syncfusion/ej2-base": "~27.1.53",
36
+ "@syncfusion/ej2-buttons": "~27.1.53",
37
+ "@syncfusion/ej2-dropdowns": "~27.1.53",
38
38
  "@syncfusion/ej2-inputs": "~27.1.50",
39
- "@syncfusion/ej2-navigations": "~27.1.52",
40
- "@syncfusion/ej2-popups": "~27.1.50",
39
+ "@syncfusion/ej2-navigations": "~27.1.53",
40
+ "@syncfusion/ej2-popups": "~27.1.53",
41
41
  "@syncfusion/ej2-splitbuttons": "~27.1.50"
42
42
  },
43
43
  "deprecated": false,
@@ -68,7 +68,7 @@
68
68
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
69
69
  },
70
70
  "typings": "index.d.ts",
71
- "version": "27.1.52",
71
+ "version": "27.1.53",
72
72
  "sideEffects": false,
73
73
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
74
74
  }
@@ -82,6 +82,7 @@ export declare class Draw {
82
82
  private drawCenterCircles;
83
83
  private drawRotationArcLine;
84
84
  private drawSquareLines;
85
+ private drawRoundedRect;
85
86
  private drawSelection;
86
87
  private shapeCircle;
87
88
  private shapeLine;
@@ -1386,8 +1386,13 @@ var Draw = /** @class */ (function () {
1386
1386
  var baseRadius = isTempCanvas ? radius * 10 * ((ratio.width + ratio.height) / 2) : radius * 10;
1387
1387
  var adjustedRadius = baseRadius + (baseRadius * zoomFactor);
1388
1388
  if (radius !== null) {
1389
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1390
- canvasDraw.roundRect(startX, startY, width, height, adjustedRadius);
1389
+ if (parent.isSafari) {
1390
+ this.drawRoundedRect(canvasDraw, startX, startY, width, height, adjustedRadius);
1391
+ }
1392
+ else {
1393
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1394
+ canvasDraw.roundRect(startX, startY, width, height, adjustedRadius);
1395
+ }
1391
1396
  }
1392
1397
  else {
1393
1398
  canvasDraw.rect(startX, startY, width, height);
@@ -1397,8 +1402,13 @@ var Draw = /** @class */ (function () {
1397
1402
  canvasDraw.fill();
1398
1403
  }
1399
1404
  if (radius !== null) {
1400
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1401
- canvasDraw.roundRect(startX + strokeWidth, startY + strokeWidth, width - (2 * strokeWidth), height - (2 * strokeWidth), adjustedRadius);
1405
+ if (parent.isSafari) {
1406
+ this.drawRoundedRect(canvasDraw, startX + strokeWidth, startY + strokeWidth, width - (2 * strokeWidth), height - (2 * strokeWidth), adjustedRadius);
1407
+ }
1408
+ else {
1409
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1410
+ canvasDraw.roundRect(startX + strokeWidth, startY + strokeWidth, width - (2 * strokeWidth), height - (2 * strokeWidth), adjustedRadius);
1411
+ }
1402
1412
  }
1403
1413
  else {
1404
1414
  canvasDraw.rect(startX + strokeWidth, startY + strokeWidth, width - (2 * strokeWidth), height - (2 * strokeWidth));
@@ -1407,6 +1417,15 @@ var Draw = /** @class */ (function () {
1407
1417
  canvasDraw.fill('evenodd');
1408
1418
  canvasDraw.closePath();
1409
1419
  };
1420
+ Draw.prototype.drawRoundedRect = function (canvasDraw, startX, startY, width, height, radius) {
1421
+ var rectRadius = Math.max(0, Math.min(radius, width / 2, height / 2));
1422
+ canvasDraw.moveTo(startX + rectRadius, startY);
1423
+ canvasDraw.arcTo(startX + width, startY, startX + width, startY + height, rectRadius);
1424
+ canvasDraw.arcTo(startX + width, startY + height, startY, startY + height, rectRadius);
1425
+ canvasDraw.arcTo(startX, startY + height, startX, startY, rectRadius);
1426
+ canvasDraw.arcTo(startX, startY, startX + width, startY, rectRadius);
1427
+ canvasDraw.closePath();
1428
+ };
1410
1429
  Draw.prototype.drawSelection = function (horLineWidth, verLineHeight) {
1411
1430
  var parent = this.parent;
1412
1431
  var actObj = parent.activeObj;
@@ -5155,10 +5174,21 @@ var Draw = /** @class */ (function () {
5155
5174
  y: sinAngle * (p2.x - center.x) + cosAngle * (p2.y - center.y) + center.y };
5156
5175
  var newP3 = { x: cosAngle * (p3.x - center.x) - sinAngle * (p3.y - center.y) + center.x,
5157
5176
  y: sinAngle * (p3.x - center.x) + cosAngle * (p3.y - center.y) + center.y };
5177
+ var tempWidth = isSaveCtx ? canvasDraw.canvas.width : img.destWidth;
5178
+ var tempHeight = isSaveCtx ? canvasDraw.canvas.height : img.destHeight;
5179
+ var rotatedWidth = Math.abs(tempWidth * Math.cos(radians)) + Math.abs(tempHeight * Math.sin(radians));
5180
+ var rotatedHeight = Math.abs(tempWidth * Math.sin(radians)) + Math.abs(tempHeight * Math.cos(radians));
5181
+ straightenCanvas.width = rotatedWidth;
5182
+ straightenCanvas.height = rotatedHeight;
5183
+ straightenCtx.save();
5184
+ straightenCtx.translate(rotatedWidth / 2, rotatedHeight / 2);
5185
+ straightenCtx.rotate(radians);
5186
+ straightenCtx.drawImage(tempCanvas, -tempCanvas.width / 2, -tempCanvas.height / 2);
5187
+ straightenCtx.restore();
5158
5188
  if (this.parent.activeObj.redactType === 'blur') {
5159
5189
  offscreenCanvas.width = width;
5160
5190
  offscreenCanvas.height = height;
5161
- offscreenCtx.drawImage(straightenCanvas, newP1.x, newP1.y, newP2.x - newP1.x, newP3.y - newP2.y, 0, 0, width, height);
5191
+ offscreenCtx.drawImage(straightenCanvas, newP1.x + ((rotatedWidth - tempCanvas.width) / 2), newP1.y + ((rotatedHeight - tempCanvas.height) / 2), newP2.x - newP1.x, newP3.y - newP2.y, 0, 0, width, height);
5162
5192
  }
5163
5193
  else {
5164
5194
  var pixelSize = (obj.redactPixelate / 100) * 20;
@@ -5167,7 +5197,7 @@ var Draw = /** @class */ (function () {
5167
5197
  }
5168
5198
  offscreenCanvas.width = Math.ceil(width / pixelSize);
5169
5199
  offscreenCanvas.height = Math.ceil(height / pixelSize);
5170
- offscreenCtx.drawImage(straightenCanvas, newP1.x, newP1.y, newP2.x - newP1.x, newP3.y - newP2.y, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
5200
+ offscreenCtx.drawImage(straightenCanvas, newP1.x + ((rotatedWidth - tempCanvas.width) / 2), newP1.y + ((rotatedHeight - tempCanvas.height) / 2), newP2.x - newP1.x, newP3.y - newP2.y, 0, 0, offscreenCanvas.width, offscreenCanvas.height);
5171
5201
  }
5172
5202
  }
5173
5203
  if (this.parent.activeObj.redactType === 'blur') {
@@ -361,7 +361,8 @@ var Shape = /** @class */ (function () {
361
361
  };
362
362
  Shape.prototype.setDimension = function (width, height) {
363
363
  var parent = this.parent;
364
- if (width && height) {
364
+ var shape = parent.activeObj.shape;
365
+ if ((width && height) || ((shape === 'line' || shape === 'arrow') && (width || height))) {
365
366
  parent.activeObj.activePoint.width = width;
366
367
  parent.activeObj.activePoint.height = height;
367
368
  if (parent.currObjType.shape.toLowerCase() === 'ellipse') {
@@ -409,7 +410,7 @@ var Shape = /** @class */ (function () {
409
410
  strokeSettings.strokeWidth = 0;
410
411
  }
411
412
  strokeSettings.strokeColor = strokeColor ? strokeColor : strokeSettings.strokeColor;
412
- strokeSettings.fillColor = fillColor ? fillColor : strokeSettings.fillColor;
413
+ strokeSettings.fillColor = fillColor || fillColor === '' ? fillColor : strokeSettings.fillColor;
413
414
  strokeSettings.radius = radius ? radius : strokeSettings.radius;
414
415
  var tempWidth = parent.img.destWidth > 100 ? 100 : parent.img.destWidth / 2;
415
416
  var tempHeight = parent.img.destHeight > 100 ? 100 : parent.img.destHeight / 2;
@@ -641,7 +641,9 @@ var ImageEditor = /** @class */ (function (_super) {
641
641
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
642
642
  var supportObj = { key: 'SupportText' };
643
643
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
644
- content = '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, and SVG</b></span>';
644
+ var andObj = { key: 'And' };
645
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: andObj } });
646
+ content = '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, ' + andObj['value'] + ' SVG</b></span>';
645
647
  }
646
648
  var dialog = new Dialog({
647
649
  header: headerObj['value'],