diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-10-15 11:05:08 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-10-15 11:05:08 -0400 |
| commit | 72ea86e603793ac17a9113ab031d31b369f74a4f (patch) | |
| tree | dd69786d1d3ee5f62c107706d8186336fb9edc24 /public/assets/javascripts/rectangles/engine/map/ui_editor.js | |
| parent | 32f5f24b8b09998a03c88f786507ba4d58397fc7 (diff) | |
| parent | f0c06d7e9fb004e840821b502a6c46214f6757fd (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 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/ui_editor.js b/public/assets/javascripts/rectangles/engine/map/ui_editor.js index 6dc6c90..072ff7e 100644 --- a/public/assets/javascripts/rectangles/engine/map/ui_editor.js +++ b/public/assets/javascripts/rectangles/engine/map/ui_editor.js @@ -161,6 +161,8 @@ Map.UI.Editor = function(map){ cursor.y.abs().quantize(1) var room = Rooms.add_with_rect( cursor ) + Rooms.rebuild() + UndoStack.push({ type: "create-room", undo: { id: room.id }, @@ -201,7 +203,7 @@ Map.UI.Editor = function(map){ var wheelState, wheelTimeout - function mousewheel (e, val, delta){ + function mousewheel (e, deltaY, deltaX){ var cursor = base.mouse.cursor var intersects = Rooms.filter(function(r){ @@ -211,7 +213,7 @@ Map.UI.Editor = function(map){ if (intersects.length) { wheelState = wheelState || intersects[0].copy() - intersects[0].height = clamp( ~~(intersects[0].height - delta), height_min, height_max ) + intersects[0].height = clamp( ~~(intersects[0].height - deltaY), height_min, height_max ) clearTimeout(wheelTimeout) wheelTimeout = setTimeout(function(){ @@ -225,7 +227,7 @@ Map.UI.Editor = function(map){ }, 500) } else { - map.set_zoom(map.zoom_exponent - delta/20) + map.set_zoom(map.zoom_exponent - deltaY/20) } } |
