From e46886c6382bd2517eca07826e9a2cf6cb353962 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 21 Nov 2014 13:50:30 -0500 Subject: right/left bracket to resize brush --- js/matrix.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'js/matrix.js') diff --git a/js/matrix.js b/js/matrix.js index ff734bf..8108568 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -87,4 +87,16 @@ Matrix.prototype.ascii = function () { }).filter(function(line){ return line.length > 0 }) var txt = '/exec -out printf "' + lines.join("\\n") + '"\n' return txt -} \ No newline at end of file +} +Matrix.prototype.expand = function(i){ + var w = this.w = clamp(this.w+i, 1, 9), h = this.h = clamp(this.h+i, 1, 9) + console.log(w,h) + controls.width.char = ""+w + controls.width.build() + controls.height.char = ""+h + controls.height.build() + this.rebuild() +} +Matrix.prototype.contract = function(i){ + brush.expand(-i) +} -- cgit v1.2.3-70-g09d2