Merge pull request #3358 from Trufi/change-translate3d-detection

Change translate3d detection
This commit is contained in:
Vladimir Agafonkin 2015-04-08 01:00:54 +03:00
commit 372f4ac128
2 changed files with 5 additions and 8 deletions

View File

@ -21,7 +21,7 @@
ie3d = ie && ('transition' in doc.style),
webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23,
gecko3d = 'MozPerspective' in doc.style,
opera3d = 'OTransition' in doc.style;
opera12 = 'OTransition' in doc.style;
var touch = !window.L_NO_TOUCH && !phantomjs && (pointer || 'ontouchstart' in window ||
(window.DocumentTouch && document instanceof window.DocumentTouch));
@ -39,8 +39,8 @@
ie3d: ie3d,
webkit3d: webkit3d,
gecko3d: gecko3d,
opera3d: opera3d,
any3d: !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d) && !phantomjs,
opera12: opera12,
any3d: !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantomjs,
mobile: mobile,
mobileWebkit: mobile && webkit,

View File

@ -140,13 +140,10 @@ L.DomUtil = {
},
setTransform: function (el, offset, scale) {
var pos = offset || new L.Point(0, 0),
is3d = L.Browser.webkit3d,
open = 'translate' + (is3d ? '3d' : '') + '(',
close = (is3d ? ',0' : '') + ')';
var pos = offset || new L.Point(0, 0);
el.style[L.DomUtil.TRANSFORM] =
open + pos.x + 'px,' + pos.y + 'px' + close + (scale ? ' scale(' + scale + ')' : '');
'translate3d(' + pos.x + 'px,' + pos.y + 'px' + ',0)' + (scale ? ' scale(' + scale + ')' : '');
},
setPosition: function (el, point, no3d) { // (HTMLElement, Point[, Boolean])