Skip to content

Commit

Permalink
Load new tiles in the correct position
Browse files Browse the repository at this point in the history
MM.moveElement in MM.Layer.positionTile did not take account of the scale when setting the tile position.
  • Loading branch information
gmaclennan committed Nov 14, 2013
1 parent a3c11e1 commit 556c3a5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/layer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Layer
MM.Layer = function(provider, parent, name) {
this.parent = parent || document.createElement('div');
Expand Down Expand Up @@ -319,9 +318,9 @@

MM.moveElement(tile, {
x: Math.round((this.map.dimensions.x* 0.5) +
(tile.coord.column - theCoord.column) * this.map.tileSize.x),
(tile.coord.column - theCoord.column) * this.map.tileSize.x * scale),
y: Math.round((this.map.dimensions.y* 0.5) +
(tile.coord.row - theCoord.row) * this.map.tileSize.y),
(tile.coord.row - theCoord.row) * this.map.tileSize.y * scale),
scale: scale,
// TODO: pass only scale or only w/h
width: this.map.tileSize.x,
Expand Down

0 comments on commit 556c3a5

Please sign in to comment.