diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-07-21 13:23:22 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-07-21 13:23:22 -0400 |
| commit | 44642b48203b3ee2fa9e281f31ed9fed3f60ee79 (patch) | |
| tree | 2a08c83ab4aad41274cd1c9ace91753a250a6e6d /public/assets/javascripts/rectangles/engine/map/tools/position.js | |
| parent | c6a22d43e82d989e73d1be9894c1c9ae9446033d (diff) | |
find closest segment
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/tools/position.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/map/tools/position.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/tools/position.js b/public/assets/javascripts/rectangles/engine/map/tools/position.js new file mode 100644 index 0000000..a994f5a --- /dev/null +++ b/public/assets/javascripts/rectangles/engine/map/tools/position.js @@ -0,0 +1,17 @@ +var PositionTool = MapTool.extend(function(base){ + var exports = { + 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 + } + } + return exports +})
\ No newline at end of file |
