summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-05-10 15:58:52 -0400
committerJules Laplace <jules@okfoc.us>2016-05-10 15:58:52 -0400
commit17f2644e3d885c8aef170023c84933e5bd888402 (patch)
tree38502ca528d14605f202e49b22ec6dedf1580d34 /js
parent130a69fbfdf83c1e47344942b35abc094778109e (diff)
more convenient canvas.get syntax..
Diffstat (limited to 'js')
-rw-r--r--js/matrix.js7
-rw-r--r--js/ui/controls.js2
2 files changed, 8 insertions, 1 deletions
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()