From 796e1194d13bfa16f41676d81f7d9cdb4b9fc96f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 24 Apr 2014 11:56:22 -0400 Subject: mouse events on walls (prism box) --- assets/javascripts/rectangles/models/room.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'assets/javascripts/rectangles/models/room.js') diff --git a/assets/javascripts/rectangles/models/room.js b/assets/javascripts/rectangles/models/room.js index 4d83d56..f0ebc76 100644 --- a/assets/javascripts/rectangles/models/room.js +++ b/assets/javascripts/rectangles/models/room.js @@ -30,6 +30,18 @@ window.room = (function(){ this.$floor = $([]) this.$ceiling = $([]) } + + room.prototype.bind = function(){ + this.$walls.bind({ + mouseover: function(){ + }, + mousemove: function(e){ + }, + mousedown: function(){ + $(this).css("background-color", choice(window.palettes.colors)) + } + }) + } room.prototype.clipTo = function(r){ // for each of this rect's regions split the region if necessary @@ -86,9 +98,3 @@ window.room = (function(){ })() -function bitcount(v) { - v = v - ((v >>> 1) & 0x55555555); - v = (v & 0x33333333) + ((v >>> 2) & 0x33333333); - return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24; -} - -- cgit v1.2.3-70-g09d2