From 61baf5d4cdb6dd8aaf11d4df43632ea7710a2d50 Mon Sep 17 00:00:00 2001 From: Robert Kolner Date: Fri, 23 Mar 2012 19:10:27 +0100 Subject: [PATCH] Canvases can now use css size attributes. --- tetris-canvas.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tetris-canvas.js b/tetris-canvas.js index a267a89..cb8b0a7 100644 --- a/tetris-canvas.js +++ b/tetris-canvas.js @@ -76,6 +76,8 @@ function TetrisCanvas(canvasId, width) { this.sHeight = Math.floor(this.pxHeight / (this.pxRectSize + this.pxSeparatorSize)); + // Adjust canvas attributes: + $("#"+canvasId).attr({ width: this.pxWidth, height: this.pxHeight }); this.context = canvas.getContext("2d"); }