@syncfusion/ej2-image-editor 23.2.5 → 23.2.7

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.
@@ -7129,8 +7129,14 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
7129
7129
  if (isBlazor() && parent.events && parent.events.shapeChanging.hasDelegate === true) {
7130
7130
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
7131
7131
  parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs).then(function (shapeChangingArgs) {
7132
- parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7133
7132
  _this.penStrokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
7133
+ if (parent.activeObj.strokeSettings.strokeColor !== shapeChangingArgs.currentShapeSettings.strokeColor) {
7134
+ parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7135
+ var penColorElement = parent.element.querySelector('.e-ie-toolbar-e-pen-color .e-dropdownbtn-preview');
7136
+ if (penColorElement) {
7137
+ penColorElement.style.background = shapeChangingArgs.currentShapeSettings.strokeColor;
7138
+ }
7139
+ }
7134
7140
  if (_this.fhdSelID) {
7135
7141
  parent.pointColl[_this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7136
7142
  parent.pointColl[_this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
@@ -7145,8 +7151,11 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
7145
7151
  }
7146
7152
  else {
7147
7153
  parent.trigger('shapeChanging', shapeChangingArgs);
7148
- parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7149
7154
  this.penStrokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
7155
+ if (parent.activeObj.strokeSettings.strokeColor !== shapeChangingArgs.currentShapeSettings.strokeColor) {
7156
+ parent.activeObj.strokeSettings.strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7157
+ parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
7158
+ }
7150
7159
  if (this.fhdSelID) {
7151
7160
  parent.pointColl[this.fhdSelIdx].strokeColor = shapeChangingArgs.currentShapeSettings.strokeColor;
7152
7161
  parent.pointColl[this.fhdSelIdx].strokeWidth = shapeChangingArgs.currentShapeSettings.strokeWidth;
@@ -11082,6 +11091,10 @@ var Selection = /** @__PURE__ @class */ (function () {
11082
11091
  Selection.prototype.performEnterAction = function (e) {
11083
11092
  var parent = this.parent;
11084
11093
  if (parent.isResize) {
11094
+ var isValue = this.isValueUpdated();
11095
+ if (!isValue) {
11096
+ return;
11097
+ }
11085
11098
  var point = this.getNumTextValue();
11086
11099
  var aspectRatioElement = this.parent.element.querySelector('#' + this.parent.element.id + '_aspectratio');
11087
11100
  var blrAspRatElem = this.parent.element.querySelector('.e-ie-toolbar-aspect-ratio-btn');
@@ -11111,15 +11124,19 @@ var Selection = /** @__PURE__ @class */ (function () {
11111
11124
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
11112
11125
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
11113
11126
  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';
11127
+ if (aspectRatioHeight) {
11128
+ var elem = getComponent(aspectRatioHeight, 'numerictextbox');
11129
+ if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
11130
+ elem.value = parseFloat(elem.placeholder);
11131
+ aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
11132
+ }
11133
+ }
11134
+ if (aspectRatioWidth) {
11135
+ var elem = getComponent(aspectRatioWidth, 'numerictextbox');
11136
+ if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
11137
+ elem.value = parseFloat(elem.placeholder);
11138
+ aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
11139
+ }
11123
11140
  }
11124
11141
  }
11125
11142
  }
@@ -12096,6 +12113,25 @@ var Selection = /** @__PURE__ @class */ (function () {
12096
12113
  }
12097
12114
  return { x: width, y: height };
12098
12115
  };
12116
+ Selection.prototype.isValueUpdated = function () {
12117
+ var isValue = true;
12118
+ var widthElement;
12119
+ var heightElement;
12120
+ if (!isBlazor()) {
12121
+ widthElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeWidth');
12122
+ heightElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeHeight');
12123
+ }
12124
+ else {
12125
+ widthElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-numerictextbox');
12126
+ heightElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
12127
+ }
12128
+ if (widthElement && heightElement) {
12129
+ if (heightElement.value.replace(/,/g, '') === '' && widthElement.value.replace(/,/g, '') === '') {
12130
+ isValue = false;
12131
+ }
12132
+ }
12133
+ return isValue;
12134
+ };
12099
12135
  return Selection;
12100
12136
  }());
12101
12137
 
@@ -16634,7 +16670,8 @@ var Transform = /** @__PURE__ @class */ (function () {
16634
16670
  }
16635
16671
  };
16636
16672
  Transform.prototype.getCurrentZoomFactor = function (zoomFactor) {
16637
- return (zoomFactor - this.prevZoomValue) * 0.1;
16673
+ return zoomFactor >= 1 ? (this.prevZoomValue < 1 ? (zoomFactor - this.prevZoomValue) : (zoomFactor - this.prevZoomValue) * 0.1) :
16674
+ (zoomFactor - this.prevZoomValue);
16638
16675
  };
16639
16676
  Transform.prototype.setCurrPanRegion = function (region, type, obj) {
16640
16677
  var panRegion = region;
@@ -19281,6 +19318,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
19281
19318
  this.currentFilter = '';
19282
19319
  this.tempFrameZoomLevel = null;
19283
19320
  this.cxtTbarHeight = null;
19321
+ this.aspectWidth = this.aspectHeight = null;
19284
19322
  var obj_1 = { initialZoomValue: false };
19285
19323
  this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
19286
19324
  if (obj_1['initialZoomValue']) {
@@ -22414,13 +22452,17 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22414
22452
  ToolbarModule.prototype.getResizeToolbarItem = function () {
22415
22453
  var toolbarItems = [];
22416
22454
  var isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
22455
+ var width = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
22456
+ Math.ceil(this.parent.img.srcHeight).toString() : Math.ceil(this.parent.img.srcWidth).toString();
22457
+ var height = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
22458
+ Math.ceil(this.parent.img.srcWidth).toString() : Math.ceil(this.parent.img.srcHeight).toString();
22417
22459
  var spanWidth = document.createElement('span');
22418
22460
  spanWidth.innerHTML = this.l10n.getConstant('W');
22419
22461
  toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
22420
22462
  toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
22421
22463
  tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
22422
22464
  showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
22423
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
22465
+ placeholder: isResize ? null : width, format: '###.## px' })
22424
22466
  });
22425
22467
  var spanHeight = document.createElement('span');
22426
22468
  spanHeight.innerHTML = this.l10n.getConstant('H');
@@ -22428,7 +22470,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22428
22470
  toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
22429
22471
  tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
22430
22472
  showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
22431
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
22473
+ placeholder: isResize ? null : height, format: '###.## px' })
22432
22474
  });
22433
22475
  if (!this.isAspectRatio) {
22434
22476
  toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });