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

index 0bf66e0..33b41d7 100644 (file)
@@ -887,6 +887,11 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                 sx = sx < 0 ? 0 : (sx / this.getScaleLevel());
                 sy = sy < 0 ? 0 : (sy / this.getScaleLevel());
 
+                context.filLStyle = '#FF0000';
+                console.log(canvas.width);
+                console.log(canvas.height);
+                context.fillRect(0, 0, canvas.width, canvas.height);
+
                 if(canvas.width > this.outputMaxWidth) {
                     var scale = this.outputMaxWidth / canvas.width;
                     canvas.width = canvas.width * scale;
@@ -894,11 +899,6 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                     context.scale(scale, scale);
                 }
 
-                context.filLStyle = '#FF0000';
-                console.log(canvas.width);
-                console.log(canvas.height);
-                context.fillRect(0, 0, canvas.width, canvas.height);
-
                 context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);
                 
                 break;