Adapt display to be able to handle a changing clipping-setting while connected

This commit is contained in:
samhed 2015-06-25 14:58:57 +02:00
parent 5fdefbf3b0
commit 6c47cdcddb
1 changed files with 6 additions and 5 deletions

View File

@ -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);