From b1260ec54779359ac866bd9465788aca18351e2c Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Mon, 18 May 2015 19:06:13 +0200 Subject: refactor how canvas resize fields work to support arrow keys --- js/matrix.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/matrix.js') diff --git a/js/matrix.js b/js/matrix.js index 7327727..ee80381 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -131,8 +131,11 @@ Matrix.prototype.getCell = function(x,y){ else return null } Matrix.prototype.resize = function(w,h){ + w = w || canvas.w + h = h || canvas.h + console.log("resize to", w, h) var div, row, lex - var f = this.f, old_h = this.h, old_w = this.w + var f = this.f, old_h = this.aa.length, old_w = this.aa[0].length var rapper = this.rapper w = max(w, 1) h = max(h, 1) -- cgit v1.2.3-70-g09d2