summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/map/tools/line.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/tools/line.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/map/tools/line.js16
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