diff --git a/resources/js/components/assets/Editor/CropEditor.vue b/resources/js/components/assets/Editor/CropEditor.vue index ea9865f35f..45793fb4d5 100644 --- a/resources/js/components/assets/Editor/CropEditor.vue +++ b/resources/js/components/assets/Editor/CropEditor.vue @@ -38,6 +38,7 @@ const showConfirmation = ref(false); const uploading = ref(false); const pendingBlob = ref(null); const pendingMimeType = ref(null); +const cropDimensions = ref(null); const aspectRatios = ref(Statamic.$config.get('cropAspectRatios') || []); @@ -67,6 +68,7 @@ function resetState() { uploading.value = false; pendingBlob.value = null; pendingMimeType.value = null; + cropDimensions.value = null; } function destroyCropper() { @@ -118,9 +120,17 @@ function createCropper(imageElement) { cropstart: onCropStart, cropmove: onCropMove, cropend: onCropEnd, + crop: onCrop, }); } +function onCrop(event) { + cropDimensions.value = { + width: Math.round(event.detail.width), + height: Math.round(event.detail.height), + }; +} + function onCropStart() { const cropBoxData = cropper.value.getCropBoxData(); initialCropBoxCenter.value = { @@ -446,6 +456,13 @@ function close() {