diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-04-21 18:44:06 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-04-21 18:44:06 -0400 |
| commit | 5e795dbab647d9d8c4285233e1efc6262d49f720 (patch) | |
| tree | 2d727f1947af8650db5cfc5ac2f0f8e1fad744bd /assets/javascripts/rectangles/map/ui.js | |
| parent | 0a7a3a60b15d9bd6cdb9e7f153eb93f6686b8c37 (diff) | |
coordinate stuff
Diffstat (limited to 'assets/javascripts/rectangles/map/ui.js')
| -rw-r--r-- | assets/javascripts/rectangles/map/ui.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/assets/javascripts/rectangles/map/ui.js b/assets/javascripts/rectangles/map/ui.js index f08cae0..f4fc0ef 100644 --- a/assets/javascripts/rectangles/map/ui.js +++ b/assets/javascripts/rectangles/map/ui.js @@ -25,7 +25,7 @@ map.ui = new function(){ function down (e, cursor){ cursor.x.div(map.zoom).add( map.center.a + map.bounds.a/2 ) cursor.y.div(map.zoom).add( -map.center.b - map.bounds.b/2 ) -console.log(cursor+"") + if (e.ctrlKey || e.which === 3) { map.center.a = cursor.x.a + map.bounds.a * map.zoom map.center.b = -cursor.y.a + map.bounds.b * map.zoom @@ -55,8 +55,10 @@ console.log(cursor+"") } function move (e, cursor) { - cursor.x.div(map.zoom).add( map.center.a + map.bounds.a/2 ) - cursor.y.div(map.zoom).add( -map.center.b - map.bounds.b/2 ) + cursor.x.div(w).sub(0.5) + cursor.y.div(h).sub(0.5) +// cursor.x.div(map.zoom).add( map.center.a + map.bounds.a/2 ) +// cursor.y.div(map.zoom).add( -map.center.b - map.bounds.b/2 ) } function drag (e, cursor) { |
