diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-30 17:11:13 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-30 17:11:13 -0400 |
| commit | ed786fddd4e65f6c9dfb95371d57deb4696273f4 (patch) | |
| tree | 56afa4eac1e145ed3ed40e6df31a25c27ddf6e43 /public/assets/test | |
| parent | e7da98b364c7792d9ff18d166613b4934c86030f (diff) | |
work out positioning logic
Diffstat (limited to 'public/assets/test')
| -rw-r--r-- | public/assets/test/ortho3.html | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/public/assets/test/ortho3.html b/public/assets/test/ortho3.html index 319f788..6bf2619 100644 --- a/public/assets/test/ortho3.html +++ b/public/assets/test/ortho3.html @@ -78,6 +78,7 @@ app.off = function(){ app.tube.off.apply(app.tube, arguments) } var MapTool = Fiber.extend(function(base){ var exports = { + recenterCursor: true, down: function(e, cursor){}, move: function(e, cursor){}, drag: function(e, cursor){}, @@ -136,14 +137,18 @@ var ArrowTool = MapTool.extend(function(base){ var PositionTool = MapTool.extend(function(base){ var exports = { - down: function(e, cursor){ + recenterCursor: false, + drag: function(e, cursor){ + map.center.a = -cursor.x.magnitude() + map.center.b = cursor.y.magnitude() + }, + rightclick: function(e, cursor){ cursor.quantize(1/map.zoom) map.center.a = cursor.x.a map.center.b = -cursor.y.a cursor.x.b = cursor.x.a cursor.y.b = cursor.y.a - map.ui.mouse.down = false - }, + } } return exports }) @@ -167,7 +172,7 @@ var PolylineTool = MapTool.extend(function (base) { } return } - map.ui.tools.position.down(e, cursor) + map.ui.tools.position.rightclick(e, cursor) return } @@ -216,7 +221,6 @@ var OrthoPolylineTool = MapTool.extend(function (base) { var exports = {} exports.down = function(e, cursor){ - // rightclick? if (e.ctrlKey || e.which === 3) { e.preventDefault() @@ -232,7 +236,9 @@ var OrthoPolylineTool = MapTool.extend(function (base) { } return } - map.ui.tools.position.down(e, cursor) + else { + map.ui.tools.position.rightclick(e, cursor) + } return } |
