diff options
| author | ryderr <r@okfoc.us> | 2014-10-16 10:43:17 -0400 |
|---|---|---|
| committer | ryderr <r@okfoc.us> | 2014-10-16 10:43:17 -0400 |
| commit | 5f91a568db7f69489851c373e54cf911d29e3054 (patch) | |
| tree | 3b92d3a0782353fefa8967c78762d324913df730 /public/assets/javascripts/rectangles/engine/map/ui_editor.js | |
| parent | 20f37d08394df097db45e0092e4420f31b5be161 (diff) | |
| parent | 1a15b32d8cc8fcf27861f94151ca63eb6d8736c2 (diff) | |
merge
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/ui_editor.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/map/ui_editor.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/ui_editor.js b/public/assets/javascripts/rectangles/engine/map/ui_editor.js index 072ff7e..9d69990 100644 --- a/public/assets/javascripts/rectangles/engine/map/ui_editor.js +++ b/public/assets/javascripts/rectangles/engine/map/ui_editor.js @@ -26,6 +26,13 @@ Map.UI.Editor = function(map){ resize: true, destroy: false, }) + + base.blur = function(){ + Rooms.forEach(function(r){ + return r.focused = false + }) + app.tube("builder-pick-nothing") + } // @@ -190,7 +197,7 @@ Map.UI.Editor = function(map){ }) Rooms.rebuild() } - + var intersects = Rooms.filter(function(r){ return r.focused = r.rect.contains(cursor.x.a, cursor.y.a) }) @@ -207,13 +214,14 @@ Map.UI.Editor = function(map){ var cursor = base.mouse.cursor var intersects = Rooms.filter(function(r){ - return r.focused = r.rect.contains(cursor.x.a, cursor.y.a) + return r.focused // = r.rect.contains(cursor.x.a, cursor.y.a) }) if (intersects.length) { wheelState = wheelState || intersects[0].copy() - intersects[0].height = clamp( ~~(intersects[0].height - deltaY), height_min, height_max ) + intersects[0].height = clamp( ~~(intersects[0].height + deltaY * 2), height_min, height_max ) + app.tube("builder-pick-room", intersects[0]) clearTimeout(wheelTimeout) wheelTimeout = setTimeout(function(){ @@ -224,7 +232,7 @@ Map.UI.Editor = function(map){ }) Rooms.rebuild() wheelState = null - }, 500) + }, 250) } else { map.set_zoom(map.zoom_exponent - deltaY/20) @@ -233,4 +241,5 @@ Map.UI.Editor = function(map){ function rightclick (e){ } + } |
