Roo/dialog/UploadCropbox.js
authorleon <leon@roojs.com>
Wed, 20 Jul 2022 09:00:41 +0000 (17:00 +0800)
committerleon <leon@roojs.com>
Wed, 20 Jul 2022 09:00:41 +0000 (17:00 +0800)
Roo/dialog/UploadCropbox.js

index 6e81674..49da37a 100644 (file)
@@ -887,9 +887,6 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                 sx = sx < 0 ? 0 : (sx / this.getScaleLevel());
                 sy = sy < 0 ? 0 : (sy / this.getScaleLevel());
 
-                context.fillStyle = 'white';
-                context.fillRect(0, 0, canvas.width, canvas.height);
-
                 if(canvas.width > this.outputMaxWidth) {
                     var scale = this.outputMaxWidth / canvas.width;
                     // canvas.width = canvas.width * scale;
@@ -897,6 +894,9 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                     context.scale(scale, scale);
                 }
 
+                context.fillStyle = 'white';
+                context.fillRect(0, 0, canvas.width, canvas.height);
+
                 context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);
                 
                 break;