Skip to content

Commit

Permalink
Adapt display to be able to handle a changing clipping-setting while …
Browse files Browse the repository at this point in the history
…connected
  • Loading branch information
samhed committed Jun 25, 2015
1 parent 7d1dc09 commit 6e296bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/display.js
Expand Up @@ -229,13 +229,14 @@ var Display;
saveImg = this._drawCtx.getImageData(0, 0, img_width, img_height);
}

if (canvas.width !== width) { canvas.width = width; }
if (canvas.height !== height) { canvas.height = height; }

if (this._viewport) {
canvas.style.height = height + 'px';
if (canvas.width !== width) {
canvas.width = width;
canvas.style.width = width + 'px';
}
if (canvas.height !== height) {
canvas.height = height;
canvas.style.height = height + 'px';
}

if (saveImg) {
this._drawCtx.putImageData(saveImg, 0, 0);
Expand Down

0 comments on commit 6e296bf

Please sign in to comment.