Fixed IE9/IE10 control panel scaling bug

This commit is contained in:
Jeff Parsons 2015-02-03 16:56:46 -08:00 • committed by jeffpar
commit 5477c1ae3e
6 changed files with 22 additions and 10 deletions

View file

@ -258,6 +258,18 @@ Panel.prototype.setBinding = function(sHTMLType, sBinding, control)
this.canvas = control;
this.context = this.canvas.getContext("2d");
/*
* Employ the same gross onresize() hack for IE9/IE10 that we had to use for the Video canvas
*/
if (web.getUserAgent().indexOf("MSIE") >= 0) {
this.canvas.onresize = function(canvas, cx, cy) {
return function onResizeVideo() {
canvas.style.height = (((canvas.clientWidth * cy) / cx) | 0) + "px";
};
}(this.canvas, this.canvas.width, this.canvas.height);
this.canvas.onresize();
}
this.xMem = this.yMem = 0;
this.cxMem = ((this.canvas.width * Panel.LIVEMEM.CX) / Panel.LIVECANVAS.CX) | 0;
this.cyMem = this.canvas.height;