Merge pull request #1101 from avandecreme/optimize_tile_smoothing

Disable tile edge smoothing when only one tile is drawn. Fix #956
This commit is contained in:
Ian Gilman 2017-01-16 10:57:31 -08:00 committed by GitHub
commit 86783a50b9

View File

@ -1702,8 +1702,11 @@ function drawTiles( tiledImage, lastDrawn ) {
var zoom = tiledImage.viewport.getZoom(true); var zoom = tiledImage.viewport.getZoom(true);
var imageZoom = tiledImage.viewportToImageZoom(zoom); var imageZoom = tiledImage.viewportToImageZoom(zoom);
// TODO: support tile edge smoothing with tiled image rotation. // TODO: support tile edge smoothing with tiled image rotation.
if (imageZoom > tiledImage.smoothTileEdgesMinZoom && !tiledImage.iOSDevice && if (lastDrawn.length > 1 &&
tiledImage.getRotation() === 0 && $.supportsCanvas) { imageZoom > tiledImage.smoothTileEdgesMinZoom &&
!tiledImage.iOSDevice &&
tiledImage.getRotation() === 0 &&
$.supportsCanvas) {
// When zoomed in a lot (>100%) the tile edges are visible. // When zoomed in a lot (>100%) the tile edges are visible.
// So we have to composite them at ~100% and scale them up together. // 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 // Note: Disabled on iOS devices per default as it causes a native crash