diff options
| author | Julie Lala <jules@okfoc.us> | 2015-05-18 19:06:13 +0200 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2015-05-18 19:06:13 +0200 |
| commit | b1260ec54779359ac866bd9465788aca18351e2c (patch) | |
| tree | 196117505387c1b35171083a71ff50e5c3c1b1ea /js/matrix.js | |
| parent | 94ee178000e256dc41438cf4d867e1bced09563e (diff) | |
refactor how canvas resize fields work to support arrow keys
Diffstat (limited to 'js/matrix.js')
| -rw-r--r-- | js/matrix.js | 5 |
1 files changed, 4 insertions, 1 deletions
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) |
