We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8832680 commit 8c6fec0Copy full SHA for 8c6fec0
1 file changed
src/tilemap/Tileset.js
@@ -172,10 +172,11 @@ Phaser.Tileset.prototype = {
172
173
if (coordIndex >= 0 && (coordIndex + 1) < this.drawCoords.length)
174
{
175
- var sx = this.drawCoords[coordIndex];
176
- var sy = this.drawCoords[coordIndex + 1];
177
- var sw = this.tileWidth;
178
- var sh = this.tileHeight;
+ // apply "half-pixel correction" to avoid edge bleeding as much as possible
+ var sx = this.drawCoords[coordIndex] + 0.5;
+ var sy = this.drawCoords[coordIndex + 1] + 0.5;
+ var sw = this.tileWidth - 1.0;
179
+ var sh = this.tileHeight - 1.0;
180
var fd = 0;
181
182
if (flippedVal)
0 commit comments