diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-05-02 13:25:44 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-05-02 13:25:44 -0400 |
| commit | 623916fe0961c6a2baeb3038224c22575050186d (patch) | |
| tree | 0937c16eedc744fd33ae4c42fd588e206a29d44a /assets/javascripts/rectangles/map | |
| parent | b9f007562712688612269fad9c71df2d4981acaa (diff) | |
starting refactor
Diffstat (limited to 'assets/javascripts/rectangles/map')
| -rw-r--r-- | assets/javascripts/rectangles/map/draw.js | 2 | ||||
| -rw-r--r-- | assets/javascripts/rectangles/map/ui.js | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/assets/javascripts/rectangles/map/draw.js b/assets/javascripts/rectangles/map/draw.js index 8e63003..b2fc05f 100644 --- a/assets/javascripts/rectangles/map/draw.js +++ b/assets/javascripts/rectangles/map/draw.js @@ -13,7 +13,7 @@ map.draw = new function(){ ctx.translate( map.center.a, map.center.b) ctx.scale( -1, 1 ) - map.draw.regions(clipper.regions) + map.draw.regions(Rooms.regions) map.draw.mouse(map.ui.mouse.cursor) map.draw.coords() scene && map.draw.camera(scene.camera) diff --git a/assets/javascripts/rectangles/map/ui.js b/assets/javascripts/rectangles/map/ui.js index d442c99..c6ba4b3 100644 --- a/assets/javascripts/rectangles/map/ui.js +++ b/assets/javascripts/rectangles/map/ui.js @@ -45,7 +45,7 @@ map.ui = new function(){ return } - var intersects = clipper.rooms.filter(function(r){ + var intersects = Rooms.filter(function(r){ return r.focused = r.rect.contains(cursor.x.a, cursor.y.a) }) @@ -103,7 +103,7 @@ map.ui = new function(){ if (cursor.height() > side_min && cursor.width() > side_min) { cursor.x.abs().quantize(1) cursor.y.abs().quantize(1) - clipper.add_room( cursor ) + Rooms.add_with_rect( cursor ) } } @@ -120,13 +120,13 @@ map.ui = new function(){ function mousewheel (e, val, delta){ var cursor = base.mouse.cursor - var intersects = clipper.rooms.filter(function(r){ + var intersects = Rooms.filter(function(r){ return r.focused = r.rect.contains(cursor.x.a, cursor.y.a) }) if (intersects.length) { intersects[0].height = clamp( ~~(intersects[0].height - delta), height_min, height_max ) - clipper.update() + Clipper.update() } else { map.set_zoom(map.zoom_exponent - delta/20) |
