oops, didn't intend to commit this :-)

pull/89/head
jmoenig 2019-05-24 14:49:39 +02:00
rodzic 27790c7463
commit a2237ec7a8
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -91,6 +91,7 @@ WorldMap.prototype.refresh = function () {
};
WorldMap.prototype.wrapTile = function (n) {
// currently unused
var max = Math.pow(2, this.zoom);
return n < 0 ? max - n : n % max;
};
@ -179,7 +180,7 @@ WorldMap.prototype.render = function () {
ctx = this.canvas.getContext('2d');
for (x = 0; x < tileGrid.x; x += 1) {
for (y = 0; y < tileGrid.y; y += 1) {
tileX = this.wrapTile(originTile.x + x);
tileX = originTile.x + x;
tileY = originTile.y + y;
if ((tileX >= 0 && tileX < max) && (tileY >= 0 && tileY < max)) {
img = new Image();