MCPcopy
hub / github.com/greensock/GSAP / _parseTransform

Function _parseTransform

esm/CSSPlugin.js:810–1024  ·  view source on GitHub ↗
(target, uncache)

Source from the content-addressed store, hash-verified

808 target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin);
809},
810 _parseTransform = function _parseTransform(target, uncache) {
811 var cache = target._gsap || new GSCache(target);
812
813 if ("x" in cache && !uncache && !cache.uncache) {
814 return cache;
815 }
816
817 var style = target.style,
818 invertedScaleX = cache.scaleX < 0,
819 px = "px",
820 deg = "deg",
821 cs = getComputedStyle(target),
822 origin = _getComputedProperty(target, _transformOriginProp) || "0",
823 x,
824 y,
825 z,
826 scaleX,
827 scaleY,
828 rotation,
829 rotationX,
830 rotationY,
831 skewX,
832 skewY,
833 perspective,
834 xOrigin,
835 yOrigin,
836 matrix,
837 angle,
838 cos,
839 sin,
840 a,
841 b,
842 c,
843 d,
844 a12,
845 a22,
846 t1,
847 t2,
848 t3,
849 a13,
850 a23,
851 a33,
852 a42,
853 a43,
854 a32;
855 x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;
856 scaleX = scaleY = 1;
857 cache.svg = !!(target.getCTM && _isSVG(target));
858
859 if (cs.translate) {
860 // accommodate independent transforms by combining them into normal ones.
861 if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") {
862 style[_transformProp] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp] !== "none" ? cs[_transformProp] : "");
863 }
864
865 style.scale = style.rotate = style.translate = "none";
866 }
867

Callers 4

_getFunction · 0.70
_renderClearPropsFunction · 0.70
_addRawTransformPTsFunction · 0.70
CSSPlugin.jsFile · 0.70

Calls 8

_roundFunction · 0.90
_getComputedPropertyFunction · 0.70
_isSVGFunction · 0.70
_getMatrixFunction · 0.70
_applySVGOriginFunction · 0.70
_isNullTransformFunction · 0.70
_firstTwoOnlyFunction · 0.70
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…