diff options
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) { |
