@syncfusion/ej2-image-editor 24.1.45 → 24.1.46

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.
@@ -12414,8 +12414,8 @@ class Selection {
12414
12414
  actPoint.height = height;
12415
12415
  actPoint.startX = (this.dragPoint.startX = (originalWidth - width) / 2) + arcRadius;
12416
12416
  actPoint.startY = (this.dragPoint.startY = (originalHeight - height) / 2) + arcRadius;
12417
- actPoint.endX = ((originalWidth - width) / 2 + width) - arcRadius;
12418
- actPoint.endY = ((originalHeight - height) / 2 + height) - arcRadius;
12417
+ actPoint.endX = actPoint.startX + actPoint.width;
12418
+ actPoint.endY = actPoint.startY + actPoint.height;
12419
12419
  if (actPoint.startX < destLeft && destLeft + destWidth > parent.lowerCanvas.clientWidth) {
12420
12420
  actPoint.startX = destLeft;
12421
12421
  actPoint.endX = actPoint.startX + width - arcRadius;
@@ -12899,7 +12899,9 @@ class Selection {
12899
12899
  }
12900
12900
  if (!isInside) {
12901
12901
  if (isNullOrUndefined(parent.activeObj.currIndex)) {
12902
- parent.activeObj.currIndex = 'shape_' + (parent.objColl.length + 1);
12902
+ const shapeIDObj = { id: 'shape_' + (parent.objColl.length + 1) };
12903
+ parent.notify('shape', { prop: 'getNewShapeId', onPropertyChange: false, value: { obj: shapeIDObj } });
12904
+ parent.activeObj.currIndex = shapeIDObj['id'];
12903
12905
  }
12904
12906
  parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
12905
12907
  if (parent.activeObj.horTopLine !== undefined && parent.activeObj.horTopLine.startX !== 0 && parent.activeObj.horTopLine.endX
@@ -13522,6 +13524,9 @@ class Shape {
13522
13524
  case 'setFlipState':
13523
13525
  this.setFlipState(args.value['x'], args.value['y'], args.value['obj'], args.value['object']);
13524
13526
  break;
13527
+ case 'getNewShapeId':
13528
+ args.value['obj']['id'] = this.getNewShapeId();
13529
+ break;
13525
13530
  }
13526
13531
  }
13527
13532
  getModuleName() {
@@ -13910,6 +13915,7 @@ class Shape {
13910
13915
  parent.notify('selection', { prop: 'isShapeInserted', onPropertyChange: false, value: { bool: true } });
13911
13916
  if (isBlazor()) {
13912
13917
  parent.updateToolbar(parent.element, 'text');
13918
+ parent.getFontSizes();
13913
13919
  }
13914
13920
  else {
13915
13921
  parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
@@ -15976,7 +15982,7 @@ class Shape {
15976
15982
  }
15977
15983
  if (!isActObj) {
15978
15984
  if (isNullOrUndefined(parent.activeObj.currIndex)) {
15979
- parent.activeObj.currIndex = 'shape_' + (parent.objColl.length + 1);
15985
+ parent.activeObj.currIndex = this.getNewShapeId();
15980
15986
  }
15981
15987
  this.updImgRatioForActObj();
15982
15988
  const splitWords = parent.activeObj.currIndex.split('_');
@@ -16012,6 +16018,17 @@ class Shape {
16012
16018
  }
16013
16019
  }
16014
16020
  }
16021
+ getNewShapeId() {
16022
+ const parent = this.parent;
16023
+ let value = parent.objColl.length + 1;
16024
+ for (let i = 0; i < parent.objColl.length; i++) {
16025
+ if (parent.objColl[i].currIndex === 'shape_' + value) {
16026
+ value++;
16027
+ i = -1;
16028
+ }
16029
+ }
16030
+ return 'shape_' + value;
16031
+ }
16015
16032
  alignTextAreaIntoCanvas() {
16016
16033
  const parent = this.parent;
16017
16034
  const letters = parent.textArea.value;
@@ -16122,6 +16139,7 @@ class Shape {
16122
16139
  case 'text':
16123
16140
  shapeDetails.text = obj.keyHistory;
16124
16141
  shapeDetails.fontSize = obj.textSettings.fontSize;
16142
+ shapeDetails.fontFamily = obj.textSettings.fontFamily;
16125
16143
  shapeDetails.color = obj.strokeSettings.strokeColor;
16126
16144
  shapeDetails.fontStyle = [];
16127
16145
  if (obj.textSettings.bold) {
@@ -21261,6 +21279,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
21261
21279
  *
21262
21280
  */
21263
21281
  zoom(zoomFactor, zoomPoint) {
21282
+ this.isZoomBtnClick = true;
21264
21283
  this.notify('transform', { prop: 'zoom', onPropertyChange: false,
21265
21284
  value: { zoomFactor: zoomFactor, zoomPoint: zoomPoint } });
21266
21285
  this.notify('draw', { prop: 'redrawDownScale' });