mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Fixed Tile-Culling for Zoomed Camera
The fix from https://github.com/photonstorm/phaser/pull/3354/ leads to some tiles getting culled when camera is zoomed as the camera.scrollX/camera.scrollY-Properties are needed in unscaled Coordinates (World-Coordinates?) in CullTile.js Error gets bigger with distance from (0|0)
This commit is contained in:
parent
d966aaa412
commit
077d933bbb
1 changed files with 3 additions and 3 deletions
|
@ -27,8 +27,8 @@ var CullTiles = function (layer, camera, outputArray)
|
|||
var mapData = layer.data;
|
||||
var mapWidth = layer.width;
|
||||
var mapHeight = layer.height;
|
||||
var left = (camera.scrollX * tilemapLayer.scrollFactorX) - tilemapLayer.x;
|
||||
var top = (camera.scrollY * tilemapLayer.scrollFactorY) - tilemapLayer.y;
|
||||
var left = (camera.scrollX * camera.zoom * tilemapLayer.scrollFactorX) - tilemapLayer.x;
|
||||
var top = (camera.scrollY * camera.zoom * tilemapLayer.scrollFactorY) - tilemapLayer.y;
|
||||
var sx = tilemapLayer.scaleX;
|
||||
var sy = tilemapLayer.scaleY;
|
||||
var tileWidth = layer.tileWidth * sx;
|
||||
|
|
Loading…
Reference in a new issue