diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-25 12:15:14 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-25 12:52:08 -0400 |
| commit | a9bf197a6e8f91cc91d772238168d9be1beb3c4d (patch) | |
| tree | bfa86ee643077770b15d5752f1c2d7fa51f79bd8 /public/assets/javascripts/rectangles/engine/map/tools/line.js | |
| parent | 48fc9b27a77126da649959c8f74ad8faffcd6e2c (diff) | |
makin sure tests work
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/tools/line.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/map/tools/line.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/tools/line.js b/public/assets/javascripts/rectangles/engine/map/tools/line.js index 8f409a8..8fe4fff 100644 --- a/public/assets/javascripts/rectangles/engine/map/tools/line.js +++ b/public/assets/javascripts/rectangles/engine/map/tools/line.js @@ -1,3 +1,6 @@ +// This tool lets you define a very simple line between two points. +// It is used by the BlueprintScaler to specify a sample distance to scale. + var LineTool = MapTool.extend(function(base){ var exports = {} @@ -8,6 +11,17 @@ var LineTool = MapTool.extend(function(base){ var can_drag, dragging exports.down = function(e, cursor){ + + // rightclick? + if (e.ctrlKey || e.which === 3) { + cursor.quantize(1/map.zoom) + app.router.blueprintView.map.center.a = cursor.x.a + app.router.blueprintView.map.center.b = -cursor.y.a + cursor.x.b = cursor.x.a + cursor.y.b = cursor.y.a + return + } + this.cursor = cursor switch (line.length) { case 0: @@ -44,6 +58,6 @@ var LineTool = MapTool.extend(function(base){ exports.up = function(e, cursor){ can_drag = dragging = false } - + return exports })
\ No newline at end of file |
