aboutsummaryrefslogtreecommitdiffstats
path: root/web/js2.js
diff options
context:
space:
mode:
authormatthew <matthew>2006-10-07 17:55:10 +0000
committermatthew <matthew>2006-10-07 17:55:10 +0000
commitc3d00850232f9ee73c73e34e9ea671deaeba1b9e (patch)
tree47d17f5aa9f0160c068d75af6f79e8ceb5100625 /web/js2.js
parent1d3fa96c53089a9206293d1d7cc63bb090366bb3 (diff)
Don't reload tiles if it's what we already have.
Diffstat (limited to 'web/js2.js')
-rw-r--r--web/js2.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/js2.js b/web/js2.js
index 598cf32a9..c38646984 100644
--- a/web/js2.js
+++ b/web/js2.js
@@ -128,9 +128,10 @@ function update_tiles(dx, dy, noMove) {
}
}
var horizontal = floor(horizontal/6);
+ var vertical = floor(vertical/6);
+ if (!horizontal && !vertical) return;
x += horizontal;
tile_x = mod((tile_x + horizontal), 6);
- var vertical = floor(vertical/6);
y -= vertical;
tile_y = mod((tile_y + vertical), 6);
@@ -202,6 +203,7 @@ function drag_move(e) {
in_drag = true;
last_mouse_pos = mouse_pos;
mouse_pos = point;
+ YAHOO.log('Updating with '+(mouse_pos.x-last_mouse_pos.x)+','+(mouse_pos.y-last_mouse_pos.y));
update_tiles(mouse_pos.x-last_mouse_pos.x, mouse_pos.y-last_mouse_pos.y);
return false;
}
@@ -215,6 +217,7 @@ function drag_check() {
}
function drag_start(e) {
+ YAHOO.log('drag start');
if (!e) var e = window.event;
//if (e.stopPropagation) e.stopPropagation();
var point = get_posn(e);