@acorex/components 20.8.24 → 20.8.25
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.
|
@@ -529,7 +529,7 @@ class AXImageEditorViewComponent extends MXBaseComponent {
|
|
|
529
529
|
this.saveImageChange();
|
|
530
530
|
}
|
|
531
531
|
/** @ignore */
|
|
532
|
-
crop() {
|
|
532
|
+
async crop() {
|
|
533
533
|
const cropper = this.cropperWindow();
|
|
534
534
|
if (this.service.activeToolState() !== 'crop' || !cropper) {
|
|
535
535
|
return;
|
|
@@ -543,9 +543,9 @@ class AXImageEditorViewComponent extends MXBaseComponent {
|
|
|
543
543
|
this.canvasElem().nativeElement.height = cropRect.height;
|
|
544
544
|
this.ctx().putImageData(imageData, 0, 0);
|
|
545
545
|
const cropImage = this.canvasElem().nativeElement.toDataURL('image/jpeg', 1);
|
|
546
|
+
await this.saveImageChange();
|
|
546
547
|
this.setInitialImage(cropImage, false);
|
|
547
548
|
this.service.activeToolState.set(null);
|
|
548
|
-
this.saveImageChange();
|
|
549
549
|
}
|
|
550
550
|
/** @ignore */
|
|
551
551
|
rotateImage() {
|
|
@@ -629,8 +629,13 @@ class AXImageEditorContainerComponent extends classes((MXInputBaseValueComponent
|
|
|
629
629
|
}
|
|
630
630
|
#eff;
|
|
631
631
|
/** Applies the current cropper selection. */
|
|
632
|
-
crop() {
|
|
633
|
-
this.
|
|
632
|
+
async crop() {
|
|
633
|
+
const oldValue = this.value;
|
|
634
|
+
await this.view()?.crop();
|
|
635
|
+
const blobs = this.service.imageBlob();
|
|
636
|
+
if (blobs.length && this.value === oldValue) {
|
|
637
|
+
this.emitOnValueChangedEvent(oldValue, blobs);
|
|
638
|
+
}
|
|
634
639
|
}
|
|
635
640
|
get __hostClass() {
|
|
636
641
|
if (this.disabled)
|