Roo/dialog/UploadCropbox.js
[roojs1] / Roo / dialog / UploadCropbox.js
index 335dd6a..6663249 100644 (file)
@@ -561,9 +561,6 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
         
         this.startScale = this.scale;
         this.scale = (e.getWheelDelta() > 0) ? (this.scale + 1) : (this.scale - 1);
-
-        console.log("START SCALE: " + this.startScale);
-        console.log("TEST SCALE: " + this.scale);
         
         if(!this.zoomable()){
             this.scale = this.startScale;
@@ -586,11 +583,6 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
         
         var width = Math.ceil(this.imageEl.OriginWidth * this.getScaleLevel() / minScale);
         var height = Math.ceil(this.imageEl.OriginHeight * this.getScaleLevel() / minScale);
-
-        console.log("IMAGE WIDTH: " + width);
-        console.log("IMAGE HEIGHT: " + height);
-        console.log("WINDOW WIDTH: " + this.thumbEl.getWidth() / Math.pow(1.02, this.scale) / minScale );
-        console.log("WINDOW HEIGHT: " + this.thumbEl.getHeight() / Math.pow(1.02, this.scale) / minScale);
  
         var maxWidth = this.imageEl.OriginWidth;
         var maxHeight = this.imageEl.OriginHeight;
@@ -899,8 +891,14 @@ 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 - 100, canvas.height);
                     context.scale(scale, scale);
                 }
+                else {
+                    context.fillStyle = 'white';
+                    context.fillRect(0, 0, canvas.width, canvas.height);
+                }
 
                 context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);