Merge pull request #860 from avandecreme/master

Fix edge smoothing with png tiles. Fix #854
This commit is contained in:
Ian Gilman 2016-02-24 09:24:51 -08:00
commit 322bf28a3e

View File

@ -280,6 +280,17 @@ $.Tile.prototype = {
context.globalAlpha = this.opacity; context.globalAlpha = this.opacity;
if (typeof scale === 'number' && scale !== 1) {
// draw tile at a different scale
position = position.times(scale);
size = size.times(scale);
}
if (translate instanceof $.Point) {
// shift tile position slightly
position = position.plus(translate);
}
//if we are supposed to be rendering fully opaque rectangle, //if we are supposed to be rendering fully opaque rectangle,
//ie its done fading or fading is turned off, and if we are drawing //ie its done fading or fading is turned off, and if we are drawing
//an image with an alpha channel, then the only way //an image with an alpha channel, then the only way
@ -301,17 +312,6 @@ $.Tile.prototype = {
// changes as we are rendering the image // changes as we are rendering the image
drawingHandler({context: context, tile: this, rendered: rendered}); drawingHandler({context: context, tile: this, rendered: rendered});
if (typeof scale === 'number' && scale !== 1) {
// draw tile at a different scale
position = position.times(scale);
size = size.times(scale);
}
if (translate instanceof $.Point) {
// shift tile position slightly
position = position.plus(translate);
}
context.drawImage( context.drawImage(
rendered.canvas, rendered.canvas,
0, 0,