From cde872fcf7256ea41e9943be2f307a5eae77f889 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Tue, 17 Feb 2026 19:56:46 -0500 Subject: [PATCH] fix: eliminate visual shaking when adjusting crop region (#8896) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Replace the dual-image approach (dimmed + background-image in crop box) with a single and a box-shadow overlay on the crop box. The previous approach required two independently positioned images to be pixel-perfectly aligned, which caused visible jitter from sub-pixel rounding differences, especially when zoomed in. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8896-fix-eliminate-visual-shaking-when-adjusting-crop-region-3086d73d365081309703d3ab0d4ad44d) by [Unito](https://www.unito.io) --- src/components/imagecrop/WidgetImageCrop.vue | 9 +++------ src/composables/useImageCrop.ts | 12 ------------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/components/imagecrop/WidgetImageCrop.vue b/src/components/imagecrop/WidgetImageCrop.vue index d093ddad27..86e799a959 100644 --- a/src/components/imagecrop/WidgetImageCrop.vue +++ b/src/components/imagecrop/WidgetImageCrop.vue @@ -28,7 +28,7 @@ :src="imageUrl" :alt="$t('imageCrop.cropPreviewAlt')" draggable="false" - class="block size-full object-contain select-none brightness-50" + class="block size-full object-contain select-none" @load="handleImageLoad" @error="handleImageError" @dragstart.prevent @@ -36,14 +36,12 @@
-
-
+ />
{ - if (!imageUrl.value) return {} - - return { - backgroundImage: `url(${imageUrl.value})`, - backgroundSize: `${displayedWidth.value}px ${displayedHeight.value}px`, - backgroundPosition: `-${cropX.value * scaleFactor.value}px -${cropY.value * scaleFactor.value}px`, - backgroundRepeat: 'no-repeat' - } - }) - interface ResizeHandle { direction: ResizeDirection class: string @@ -605,7 +594,6 @@ export function useImageCrop(nodeId: NodeId, options: UseImageCropOptions) { isLockEnabled, cropBoxStyle, - cropImageStyle, resizeHandles, handleImageLoad,