From c780419e05bddf80b09e3091634361f289666f35 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 18 Apr 2014 14:42:01 -0400 Subject: camera cursor --- assets/javascripts/rectangles/map/ui.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'assets/javascripts/rectangles/map/ui.js') diff --git a/assets/javascripts/rectangles/map/ui.js b/assets/javascripts/rectangles/map/ui.js index 6560695..f08cae0 100644 --- a/assets/javascripts/rectangles/map/ui.js +++ b/assets/javascripts/rectangles/map/ui.js @@ -25,10 +25,13 @@ 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.b = cursor.x.a + map.bounds.a/2 - map.center.b = cursor.y.b = cursor.y.a + map.bounds.b + map.center.a = cursor.x.a + map.bounds.a * map.zoom + map.center.b = -cursor.y.a + map.bounds.b * map.zoom + console.log(map.center+"") + cursor.x.b = cursor.x.a + cursor.y.b = cursor.y.a base.mouse.down = false e.preventDefault() e.stopPropagation() -- cgit v1.2.3-70-g09d2