@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
|
@@ -12223,6 +12223,29 @@ class Selection {
|
|
|
12223
12223
|
const cursor = parent.activeObj.shape && parent.activeObj.shape === 'text' ?
|
|
12224
12224
|
parent.cursor : 'default';
|
|
12225
12225
|
const tempCursor = parent.upperCanvas.style.cursor;
|
|
12226
|
+
const textArea = document.querySelector('#' + parent.element.id + '_textArea');
|
|
12227
|
+
if (textArea.style.display === 'block' || textArea.style.display === 'inline-block') {
|
|
12228
|
+
let isShapeUnderCursor = false;
|
|
12229
|
+
for (let i = 0; i < parent.objColl.length; i++) {
|
|
12230
|
+
const actObj = parent.objColl[i];
|
|
12231
|
+
if (actObj && actObj.shape && actObj.activePoint) {
|
|
12232
|
+
const activePoint = actObj.activePoint;
|
|
12233
|
+
const startX = activePoint.startX;
|
|
12234
|
+
const startY = activePoint.startY;
|
|
12235
|
+
const endX = activePoint.endX;
|
|
12236
|
+
const endY = activePoint.endY;
|
|
12237
|
+
const radius = actObj.topLeftCircle && actObj.topLeftCircle.radius ? actObj.topLeftCircle.radius : 0;
|
|
12238
|
+
let isCursorWithinBounds = (x >= (startX - (radius * 2)) && x <= (endX + (radius * 2)) &&
|
|
12239
|
+
y >= (startY - (radius * 2)) && y <= (endY + (radius * 2)));
|
|
12240
|
+
if (isCursorWithinBounds) {
|
|
12241
|
+
isShapeUnderCursor = true;
|
|
12242
|
+
}
|
|
12243
|
+
}
|
|
12244
|
+
}
|
|
12245
|
+
if (isShapeUnderCursor) {
|
|
12246
|
+
parent.okBtn();
|
|
12247
|
+
}
|
|
12248
|
+
}
|
|
12226
12249
|
if (parent.isResize) {
|
|
12227
12250
|
this.performEnterAction(e);
|
|
12228
12251
|
parent.upperCanvas.style.cursor = 'default';
|
|
@@ -14659,6 +14682,7 @@ class Shape {
|
|
|
14659
14682
|
this.keyHistory = ''; // text history
|
|
14660
14683
|
this.preventFrameAnnotation = false;
|
|
14661
14684
|
this.redactType = 'blur';
|
|
14685
|
+
this.isPublicUpdateShape = false;
|
|
14662
14686
|
this.parent = parent;
|
|
14663
14687
|
this.addEventListener();
|
|
14664
14688
|
}
|
|
@@ -14932,6 +14956,9 @@ class Shape {
|
|
|
14932
14956
|
case 'setRedactType':
|
|
14933
14957
|
this.redactType = args.value['redactType'];
|
|
14934
14958
|
break;
|
|
14959
|
+
case 'setPublicUpdateShape':
|
|
14960
|
+
this.isPublicUpdateShape = args.value['isPublicUpdateShape'];
|
|
14961
|
+
break;
|
|
14935
14962
|
}
|
|
14936
14963
|
}
|
|
14937
14964
|
getModuleName() {
|
|
@@ -14958,7 +14985,7 @@ class Shape {
|
|
|
14958
14985
|
this.textSettings =
|
|
14959
14986
|
{ text: 'Enter Text', fontFamily: this.parent.fontFamily.default, fontSize: null, fontRatio: null, bold: false, italic: false, underline: false, strikethrough: false };
|
|
14960
14987
|
this.strokeSettings = { strokeColor: '#fff', fillColor: '', strokeWidth: null, radius: null, outlineColor: '', outlineWidth: null };
|
|
14961
|
-
this.preventFrameAnnotation = false;
|
|
14988
|
+
this.preventFrameAnnotation = this.isPublicUpdateShape = false;
|
|
14962
14989
|
}
|
|
14963
14990
|
drawEllipse(x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor, degree, isSelected) {
|
|
14964
14991
|
this.initializeShape('ellipse');
|
|
@@ -15670,7 +15697,7 @@ class Shape {
|
|
|
15670
15697
|
}
|
|
15671
15698
|
parent.notify('selection', { prop: 'setTextSelection', onPropertyChange: false,
|
|
15672
15699
|
value: { width: width, height: height } });
|
|
15673
|
-
if (parent.activeObj.rotatedAngle !== 0) {
|
|
15700
|
+
if (parent.activeObj.rotatedAngle !== 0 && !this.isPublicUpdateShape) {
|
|
15674
15701
|
const width = parent.activeObj.activePoint.width - tempActiveObj.activePoint.width;
|
|
15675
15702
|
const height = parent.activeObj.activePoint.height - tempActiveObj.activePoint.height;
|
|
15676
15703
|
let value = '';
|
|
@@ -15689,6 +15716,20 @@ class Shape {
|
|
|
15689
15716
|
parent.notify('shape', { prop: 'updateFontSize', onPropertyChange: false,
|
|
15690
15717
|
value: { obj: parent.activeObj } });
|
|
15691
15718
|
}
|
|
15719
|
+
else if (this.isPublicUpdateShape) {
|
|
15720
|
+
const width = parent.activeObj.activePoint.width - tempActiveObj.activePoint.width;
|
|
15721
|
+
const height = parent.activeObj.activePoint.height - tempActiveObj.activePoint.height;
|
|
15722
|
+
let value = '';
|
|
15723
|
+
if (parent.transform.degree === 0 || parent.transform.degree === 180) {
|
|
15724
|
+
value = 'width';
|
|
15725
|
+
}
|
|
15726
|
+
else if (parent.transform.degree === 90 || parent.transform.degree === 270) {
|
|
15727
|
+
value = 'height';
|
|
15728
|
+
}
|
|
15729
|
+
parent.activeObj.activePoint = extend({}, tempActiveObj.activePoint, {}, true);
|
|
15730
|
+
parent.notify('selection', { prop: 'adjustRotationPoints', onPropertyChange: false, value: { rectangle: parent.activeObj.activePoint,
|
|
15731
|
+
x: width, y: height, angle: parent.activeObj.rotatedAngle, type: 'text', elem: value } });
|
|
15732
|
+
}
|
|
15692
15733
|
parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: parent.activeObj.activePoint, obj: parent.activeObj,
|
|
15693
15734
|
isMouseMove: null, x: null, y: null } });
|
|
15694
15735
|
this.updImgRatioForActObj();
|
|
@@ -24112,6 +24153,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
|
|
|
24112
24153
|
*
|
|
24113
24154
|
*/
|
|
24114
24155
|
updateShape(setting, isSelected) {
|
|
24156
|
+
if (setting.type.toLowerCase() === 'text') {
|
|
24157
|
+
this.notify('shape', { prop: 'setPublicUpdateShape', onPropertyChange: false, value: { isPublicUpdateShape: true } });
|
|
24158
|
+
}
|
|
24115
24159
|
const obj = { isSelected: false };
|
|
24116
24160
|
let isTextArea = false;
|
|
24117
24161
|
const freehandObj = { bool: false };
|
|
@@ -24183,6 +24227,9 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
|
|
|
24183
24227
|
}
|
|
24184
24228
|
}
|
|
24185
24229
|
}
|
|
24230
|
+
if (setting.type.toLowerCase() === 'text') {
|
|
24231
|
+
this.notify('shape', { prop: 'setPublicUpdateShape', onPropertyChange: false, value: { isPublicUpdateShape: false } });
|
|
24232
|
+
}
|
|
24186
24233
|
return obj['isSelected'];
|
|
24187
24234
|
}
|
|
24188
24235
|
/**
|