From a23a709fb17c60615bbceb5fafea4bf198130998 Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Sat, 7 Jan 2017 19:56:37 +0100 Subject: [PATCH] Disable tile edge smoothing when only one tile is drawn. Fix #956 --- src/tiledimage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index bca7c823..21497a76 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1702,8 +1702,11 @@ function drawTiles( tiledImage, lastDrawn ) { var zoom = tiledImage.viewport.getZoom(true); var imageZoom = tiledImage.viewportToImageZoom(zoom); // TODO: support tile edge smoothing with tiled image rotation. - if (imageZoom > tiledImage.smoothTileEdgesMinZoom && !tiledImage.iOSDevice && - tiledImage.getRotation() === 0 && $.supportsCanvas) { + if (lastDrawn.length > 1 && + imageZoom > tiledImage.smoothTileEdgesMinZoom && + !tiledImage.iOSDevice && + tiledImage.getRotation() === 0 && + $.supportsCanvas) { // When zoomed in a lot (>100%) the tile edges are visible. // So we have to composite them at ~100% and scale them up together. // Note: Disabled on iOS devices per default as it causes a native crash