Browse Source

fix(ui): Fix avatar uploader image cropper on resize (#48627)

Add the current top and left position to avatar uploader image cropper
to ensure that when resizing the image cropper, the current position of
the crop area is maintained, modifying only its size.
Rodolfo Della Violla 1 year ago
parent
commit
7ca5880332
1 changed files with 2 additions and 2 deletions
  1. 2 2
      static/app/components/avatarUploader.tsx

+ 2 - 2
static/app/components/avatarUploader.tsx

@@ -238,8 +238,8 @@ class AvatarUploader extends Component<Props, State> {
     const editingLeft = resizeDirection === 'nw' || resizeDirection === 'sw';
 
     const newDimensions = {
-      top: 0,
-      left: 0,
+      top: oldDimensions.top,
+      left: oldDimensions.left,
       size: oldDimensions.size + diff,
     };