@syncfusion/ej2-image-editor 31.1.22 → 31.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/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 +49 -2
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +49 -2
- 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 +8 -8
- package/src/image-editor/action/selection.js +23 -0
- package/src/image-editor/action/shape.d.ts +1 -0
- package/src/image-editor/action/shape.js +20 -2
- package/src/image-editor/base/image-editor.js +6 -0
|
@@ -12296,6 +12296,29 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12296
12296
|
var cursor = parent.activeObj.shape && parent.activeObj.shape === 'text' ?
|
|
12297
12297
|
parent.cursor : 'default';
|
|
12298
12298
|
var tempCursor = parent.upperCanvas.style.cursor;
|
|
12299
|
+
var textArea = document.querySelector('#' + parent.element.id + '_textArea');
|
|
12300
|
+
if (textArea.style.display === 'block' || textArea.style.display === 'inline-block') {
|
|
12301
|
+
var isShapeUnderCursor = false;
|
|
12302
|
+
for (var i = 0; i < parent.objColl.length; i++) {
|
|
12303
|
+
var actObj = parent.objColl[i];
|
|
12304
|
+
if (actObj && actObj.shape && actObj.activePoint) {
|
|
12305
|
+
var activePoint_1 = actObj.activePoint;
|
|
12306
|
+
var startX = activePoint_1.startX;
|
|
12307
|
+
var startY = activePoint_1.startY;
|
|
12308
|
+
var endX = activePoint_1.endX;
|
|
12309
|
+
var endY = activePoint_1.endY;
|
|
12310
|
+
var radius = actObj.topLeftCircle && actObj.topLeftCircle.radius ? actObj.topLeftCircle.radius : 0;
|
|
12311
|
+
var isCursorWithinBounds = (x >= (startX - (radius * 2)) && x <= (endX + (radius * 2)) &&
|
|
12312
|
+
y >= (startY - (radius * 2)) && y <= (endY + (radius * 2)));
|
|
12313
|
+
if (isCursorWithinBounds) {
|
|
12314
|
+
isShapeUnderCursor = true;
|
|
12315
|
+
}
|
|
12316
|
+
}
|
|
12317
|
+
}
|
|
12318
|
+
if (isShapeUnderCursor) {
|
|
12319
|
+
parent.okBtn();
|
|
12320
|
+
}
|
|
12321
|
+
}
|
|
12299
12322
|
if (parent.isResize) {
|
|
12300
12323
|
this.performEnterAction(e);
|
|
12301
12324
|
parent.upperCanvas.style.cursor = 'default';
|
|
@@ -14733,6 +14756,7 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
14733
14756
|
this.keyHistory = ''; // text history
|
|
14734
14757
|
this.preventFrameAnnotation = false;
|
|
14735
14758
|
this.redactType = 'blur';
|
|
14759
|
+
this.isPublicUpdateShape = false;
|
|
14736
14760
|
this.parent = parent;
|
|
14737
14761
|
this.addEventListener();
|
|
14738
14762
|
}
|
|
@@ -15006,6 +15030,9 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
15006
15030
|
case 'setRedactType':
|
|
15007
15031
|
this.redactType = args.value['redactType'];
|
|
15008
15032
|
break;
|
|
15033
|
+
case 'setPublicUpdateShape':
|
|
15034
|
+
this.isPublicUpdateShape = args.value['isPublicUpdateShape'];
|
|
15035
|
+
break;
|
|
15009
15036
|
}
|
|
15010
15037
|
};
|
|
15011
15038
|
Shape.prototype.getModuleName = function () {
|
|
@@ -15032,7 +15059,7 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
15032
15059
|
this.textSettings =
|
|
15033
15060
|
{ text: 'Enter Text', fontFamily: this.parent.fontFamily.default, fontSize: null, fontRatio: null, bold: false, italic: false, underline: false, strikethrough: false };
|
|
15034
15061
|
this.strokeSettings = { strokeColor: '#fff', fillColor: '', strokeWidth: null, radius: null, outlineColor: '', outlineWidth: null };
|
|
15035
|
-
this.preventFrameAnnotation = false;
|
|
15062
|
+
this.preventFrameAnnotation = this.isPublicUpdateShape = false;
|
|
15036
15063
|
};
|
|
15037
15064
|
Shape.prototype.drawEllipse = function (x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor, degree, isSelected) {
|
|
15038
15065
|
this.initializeShape('ellipse');
|
|
@@ -15744,7 +15771,7 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
15744
15771
|
}
|
|
15745
15772
|
parent.notify('selection', { prop: 'setTextSelection', onPropertyChange: false,
|
|
15746
15773
|
value: { width: width, height: height } });
|
|
15747
|
-
if (parent.activeObj.rotatedAngle !== 0) {
|
|
15774
|
+
if (parent.activeObj.rotatedAngle !== 0 && !this.isPublicUpdateShape) {
|
|
15748
15775
|
var width_1 = parent.activeObj.activePoint.width - tempActiveObj.activePoint.width;
|
|
15749
15776
|
var height_1 = parent.activeObj.activePoint.height - tempActiveObj.activePoint.height;
|
|
15750
15777
|
var value = '';
|
|
@@ -15763,6 +15790,20 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
15763
15790
|
parent.notify('shape', { prop: 'updateFontSize', onPropertyChange: false,
|
|
15764
15791
|
value: { obj: parent.activeObj } });
|
|
15765
15792
|
}
|
|
15793
|
+
else if (this.isPublicUpdateShape) {
|
|
15794
|
+
var width_2 = parent.activeObj.activePoint.width - tempActiveObj.activePoint.width;
|
|
15795
|
+
var height_2 = parent.activeObj.activePoint.height - tempActiveObj.activePoint.height;
|
|
15796
|
+
var value = '';
|
|
15797
|
+
if (parent.transform.degree === 0 || parent.transform.degree === 180) {
|
|
15798
|
+
value = 'width';
|
|
15799
|
+
}
|
|
15800
|
+
else if (parent.transform.degree === 90 || parent.transform.degree === 270) {
|
|
15801
|
+
value = 'height';
|
|
15802
|
+
}
|
|
15803
|
+
parent.activeObj.activePoint = extend({}, tempActiveObj.activePoint, {}, true);
|
|
15804
|
+
parent.notify('selection', { prop: 'adjustRotationPoints', onPropertyChange: false, value: { rectangle: parent.activeObj.activePoint,
|
|
15805
|
+
x: width_2, y: height_2, angle: parent.activeObj.rotatedAngle, type: 'text', elem: value } });
|
|
15806
|
+
}
|
|
15766
15807
|
parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: parent.activeObj.activePoint, obj: parent.activeObj,
|
|
15767
15808
|
isMouseMove: null, x: null, y: null } });
|
|
15768
15809
|
this.updImgRatioForActObj();
|
|
@@ -24237,6 +24278,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24237
24278
|
*
|
|
24238
24279
|
*/
|
|
24239
24280
|
ImageEditor.prototype.updateShape = function (setting, isSelected) {
|
|
24281
|
+
if (setting.type.toLowerCase() === 'text') {
|
|
24282
|
+
this.notify('shape', { prop: 'setPublicUpdateShape', onPropertyChange: false, value: { isPublicUpdateShape: true } });
|
|
24283
|
+
}
|
|
24240
24284
|
var obj = { isSelected: false };
|
|
24241
24285
|
var isTextArea = false;
|
|
24242
24286
|
var freehandObj = { bool: false };
|
|
@@ -24308,6 +24352,9 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24308
24352
|
}
|
|
24309
24353
|
}
|
|
24310
24354
|
}
|
|
24355
|
+
if (setting.type.toLowerCase() === 'text') {
|
|
24356
|
+
this.notify('shape', { prop: 'setPublicUpdateShape', onPropertyChange: false, value: { isPublicUpdateShape: false } });
|
|
24357
|
+
}
|
|
24311
24358
|
return obj['isSelected'];
|
|
24312
24359
|
};
|
|
24313
24360
|
/**
|