Skip to content

Commit

Permalink
Merge branch 'fix-canvas-size-when-using-css' of https://github.com/s…
Browse files Browse the repository at this point in the history
…tepheneb/scenejs into stepheneb-fix-canvas-size-when-using-css
  • Loading branch information
xeolabs committed Feb 21, 2011
2 parents 4e77b07 + 5711b70 commit 9ef3566
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scenejs/scene/sceneModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ SceneJS._sceneModule = new (function() {
}
}
}

// If the canvas uses css styles to specify the sizes make sure the basic
// width and height attributes match or the WebGL context will use 300 x 150
canvas.width = canvas.clientWidth;
canvas.height = canvas.clientHeight;

var context;
var contextNames = SceneJS.SUPPORTED_WEBGL_CONTEXT_NAMES;
for (var i = 0; (!context) && i < contextNames.length; i++) {
Expand Down

0 comments on commit 9ef3566

Please sign in to comment.