From f07da2a12138776c687e3aa5916692992859ce84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Thu, 28 Jun 2018 14:44:54 +0200 Subject: [PATCH] Fix setTransform function for desktop webkit --- src/dom/DomUtil.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dom/DomUtil.js b/src/dom/DomUtil.js index 05085db3..01bc0a61 100644 --- a/src/dom/DomUtil.js +++ b/src/dom/DomUtil.js @@ -208,8 +208,14 @@ export function testProp(props) { export function setTransform(el, offset, scale) { var pos = offset || new Point(0, 0); - el.style[TRANSFORM] = - (Browser.ie3d ? + el.style.willChange = scale !== 1 ? 'auto' : 'transform'; + el.style[L.DomUtil.TRANSFORM] = + // Based on https://github.com/Leaflet/Leaflet/pull/5354: + // We don't want to use `translate3d` for webkit since it causes the + // white lines issue (tile's gaps) while panning or zooming: + // https://bugs.chromium.org/p/chromium/issues/detail?id=600120#c15 + // This issue does not appear on mobile devices. + (!Browser.mobile && (Browser.ie3d || Browser.webkit3d) ? 'translate(' + pos.x + 'px,' + pos.y + 'px)' : 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') + (scale ? ' scale(' + scale + ')' : '');