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;
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;
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;
+ context.scale(scale, scale);
+ }
+
+ 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.scale(scale, scale);
}
context.drawImage(imageCanvas, sx, sy, width, height, x, y, width, height);