roojs-core.js
[roojs1] / Roo / dialog / UploadCropbox.js
index 415eba3..7bc78e3 100644 (file)
@@ -891,15 +891,13 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                     var scale = this.outputMaxWidth / canvas.width;
                     canvas.width = canvas.width * scale;
                     canvas.height = canvas.height * scale;
-                    context.fillStyle = 'white';
-                    context.fillRect(0, 0, canvas.width, canvas.height);
-                    // context.scale(scale, scale);
-                }
-                else {
-                    context.fillStyle = 'white';
-                    context.fillRect(0, 0, canvas.width, canvas.height);
+                    context.scale(scale, scale);
                 }
 
+                context.fillStyle = 'white';
+                context.fillRect(0, 0, this.thumbEl.getWidth() / this.getScaleLevel(), this.thumbEl.getHeight() / this.getScaleLevel());
+
+
                 context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);
                 
                 break;