@@ -177,15 +177,15 @@ var StaticTilemap = new Class({
177177 var pixelWidth = this . mapWidth * tileWidth ;
178178 var pixelHeight = this . mapHeight * tileHeight ;
179179
180- if ( pixelX < camera . width + tileWidth &&
181- pixelX + pixelWidth > - tileWidth &&
182- pixelY < camera . height + tileHeight &&
183- pixelY + pixelHeight > - tileHeight )
180+ if ( pixelX < camera . x + camera . width + ( tileWidth * 2 ) &&
181+ pixelX + pixelWidth > camera . x + - ( tileWidth * 2 ) &&
182+ pixelY < camera . y + camera . height + ( tileHeight * 2 ) &&
183+ pixelY + pixelHeight > camera . y + - ( tileHeight * 2 ) )
184184 {
185- var interX = Math . max ( pixelX , - tileWidth ) ;
186- var interY = Math . max ( pixelY , - tileHeight ) ;
187- var interWidth = Math . min ( pixelX + pixelWidth , camera . width + tileWidth ) - interX ;
188- var interHeight = Math . min ( pixelY + pixelHeight , camera . height + tileHeight ) - interY ;
185+ var interX = Math . max ( pixelX , camera . x + - ( tileWidth * 2 ) ) ;
186+ var interY = Math . max ( pixelY , camera . y + - ( tileHeight * 2 ) ) ;
187+ var interWidth = Math . min ( pixelX + pixelWidth , camera . x + camera . width + ( tileWidth * 2 ) ) - interX ;
188+ var interHeight = Math . min ( pixelY + pixelHeight , camera . y + camera . height + ( tileHeight * 2 ) ) - interY ;
189189
190190 interX = ( ( interX + ( camera . scrollX * this . scrollFactorX ) ) / tileWidth ) | 0 ;
191191 interY = ( ( interY + ( camera . scrollY * this . scrollFactorY ) ) / tileHeight ) | 0 ;
0 commit comments