Roo/dialog/UploadCropbox.js
[roojs1] / Roo / dialog / UploadCropbox.js
index 8284d3f..bd530af 100644 (file)
@@ -887,17 +887,22 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                 sx = sx < 0 ? 0 : (sx / this.getScaleLevel());
                 sy = sy < 0 ? 0 : (sy / this.getScaleLevel());
 
+                console.log(canvas.width);
+                console.log(canvas.height);
                 if(canvas.width > this.outputMaxWidth) {
                     var scale = this.outputMaxWidth / canvas.width;
-                    canvas.width = canvas.width * scale;
-                    canvas.height = canvas.height * scale;
                     context.scale(scale, scale);
                 }
 
-                context.filLStyle = 'blue';
-                context.fillRect(10, 10, 100, 100);
+                context.fillStyle = 'white';
+                context.fillRect(0, 0, canvas.width, canvas.height);
+
+                if(canvas.width > this.outputMaxWidth) {
+                    canvas.width = canvas.width * scale;
+                    canvas.height = canvas.height * scale;
+                }
 
-                // context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);
+                context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);
                 
                 break;
             case 90 :