summaryrefslogtreecommitdiff
path: root/js/matrix.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-11-21 13:50:30 -0500
committerJules Laplace <jules@okfoc.us>2014-11-21 13:50:30 -0500
commite46886c6382bd2517eca07826e9a2cf6cb353962 (patch)
tree73ac7463f82525a568d6baff09473179733f3289 /js/matrix.js
parentfea42b1513e321b6c397c914327a9a4a7d96e331 (diff)
right/left bracket to resize brush
Diffstat (limited to 'js/matrix.js')
-rw-r--r--js/matrix.js14
1 files changed, 13 insertions, 1 deletions
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)
+}