From 274e5bfc5c8dcf09e607d1809d3e530c0ee2ad7c Mon Sep 17 00:00:00 2001 From: timb Date: Wed, 22 Jul 2015 00:34:15 -0700 Subject: oops, broke shader. brush code cleanup --- js/ui/brush.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'js/ui/brush.js') diff --git a/js/ui/brush.js b/js/ui/brush.js index 90422b7..8cc858f 100644 --- a/js/ui/brush.js +++ b/js/ui/brush.js @@ -44,7 +44,6 @@ var brush = (function(){ lex.fill(brush) } brush.focus(x, y) - // lex.focus() }) lex.span.addEventListener('mousemove', function(e){ e.preventDefault() @@ -59,7 +58,6 @@ var brush = (function(){ lex.fill(brush) } brush.focus(x, y) - //lex.focus() }) }) window.addEventListener('mouseup', function(e){ @@ -67,35 +65,23 @@ var brush = (function(){ }) } - brush.resize = function(w, h, min, max){ - this.w = clamp(w, this.min, this.max) - this.h = clamp(h, this.min, this.max) - // brush.__proto__.resize.call(brush, w, h) - // this.w = w - // this.h = h - this.rebuild() - //brush.__proto__.rebuild.call(brush, w, h) - controls.brush_w.char = ""+this.w + brush.resize = function(w, h){ + w = this.w = clamp(w, this.min, this.max) + h = this.h = clamp(h, this.min, this.max) + brush.rebuild() + controls.brush_w.char = "" + w controls.brush_w.build() - controls.brush_h.char = ""+this.h + controls.brush_h.char = "" + h controls.brush_h.build() } brush.size_add = function(w, h){ brush.resize(brush.w + w, brush.h + h) } - brush.expand = function(i){ brush.size_add(i, i) - // var w = this.w = clamp(this.w+i, 1, 9), h = this.h = clamp(this.h+i, 1, 9) - // controls.width.char = ""+w - // controls.width.build() - // controls.height.char = ""+h - // controls.height.build() - // this.rebuild() } brush.contract = function(i){ brush.size_add(-i, -i) - // this.expand(-i) } brush.load = function(lex){ -- cgit v1.2.3-70-g09d2