From e44f2ae20b96a6d5692bab56cab7452f6ad3d804 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 22 Apr 2014 13:06:27 -0400 Subject: grid that is actually quantized --- assets/javascripts/rectangles/map/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 10496e3..e7d2cf7 100644 --- a/assets/javascripts/rectangles/map/ui.js +++ b/assets/javascripts/rectangles/map/ui.js @@ -26,6 +26,7 @@ map.ui = new function(){ cursor.y.div(h).sub(0.5).mul(map.bounds.b / map.zoom).sub(map.center.b) if (e.ctrlKey || e.which === 3) { + cursor.quantize(1) map.center.a = cursor.x.a map.center.b = -cursor.y.a console.log(map.center+"") @@ -69,7 +70,6 @@ map.ui = new function(){ } function up (e, cursor, new_cursor) { - new_cursor.x.div(w).add(0.5).mul(map.bounds.a / map.zoom).add(map.center.a) new_cursor.y.div(h).sub(0.5).mul(map.bounds.b / map.zoom).sub(map.center.b) -- cgit v1.2.3-70-g09d2