diff options
| -rw-r--r-- | doc/shaders/util.txt | 13 | ||||
| -rw-r--r-- | index.html | 9 | ||||
| -rw-r--r-- | js/matrix.js | 7 | ||||
| -rw-r--r-- | js/ui/controls.js | 2 |
4 files changed, 26 insertions, 5 deletions
diff --git a/doc/shaders/util.txt b/doc/shaders/util.txt index d192652..a455eb3 100644 --- a/doc/shaders/util.txt +++ b/doc/shaders/util.txt @@ -23,3 +23,16 @@ Tip: Set to "animate brush", then use option+shift (alt+shift) to copy color from the canvas. Brush will have the "shape" of the copied color only. Can be a cool effect when used with fg/bg only. + + +>> copy color from canvas at x/y + +lex.assign( canvas.get(x,y) ) + + + +>> animate canvas up and to the left.. + +lex.assign( canvas.get(x+1,y+1) ) + + @@ -91,10 +91,11 @@ </body> <script type="text/javascript-shader" id="demo_shader"> - lex.bg = hue((x+y*y+t/10)/20) - lex.fg = colors.white - lex.char = " " - // lex.opacity = 1 +// lex.bg = hue((x+y*y+t/10)/20) +// lex.fg = colors.white +// lex.char = " " +// lex.opacity = 1 + </script> <script src="js/vendor/colorcode.js"></script> <script src="js/vendor/text-encoder-lite.js"></script> diff --git a/js/matrix.js b/js/matrix.js index 275e6b6..de59e17 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -151,6 +151,13 @@ Matrix.prototype.getCell = function(x,y){ if (this.aa[y] && this.aa[y][x]) return this.aa[y][x] else return null } +Matrix.prototype.get = function(x,y){ + y = floor(mod(y || 0, this.h)) + x = floor(mod(x || 0, this.w)) + if (this.aa[y] && this.aa[y][x]) return this.aa[y][x] + else return null +} + Matrix.prototype.resize = function(w,h){ w = w || canvas.w h = h || canvas.h diff --git a/js/ui/controls.js b/js/ui/controls.js index c191cc2..9139989 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -37,6 +37,7 @@ var controls = (function(){ controls.text = new Tool (text_el) controls.text.use = function(){ + current_filetool && current_filetool.blur() } controls.select = new Tool (select_el) @@ -111,7 +112,6 @@ var controls = (function(){ if (! selection.hidden) selection.reposition() this.update( state ) } - ClipboardTool = FileTool.extend({ blur: function(){ this.__blur() |
