MCPcopy Index your code
hub / github.com/greensock/GSAP / _renderSVGTransforms

Function _renderSVGTransforms

esm/CSSPlugin.js:1112–1201  ·  view source on GitHub ↗
(ratio, cache)

Source from the content-addressed store, hash-verified

1110 target.style[_transformProp] = transforms || "translate(0, 0)";
1111},
1112 _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) {
1113 var _ref2 = cache || this,
1114 xPercent = _ref2.xPercent,
1115 yPercent = _ref2.yPercent,
1116 x = _ref2.x,
1117 y = _ref2.y,
1118 rotation = _ref2.rotation,
1119 skewX = _ref2.skewX,
1120 skewY = _ref2.skewY,
1121 scaleX = _ref2.scaleX,
1122 scaleY = _ref2.scaleY,
1123 target = _ref2.target,
1124 xOrigin = _ref2.xOrigin,
1125 yOrigin = _ref2.yOrigin,
1126 xOffset = _ref2.xOffset,
1127 yOffset = _ref2.yOffset,
1128 forceCSS = _ref2.forceCSS,
1129 tx = parseFloat(x),
1130 ty = parseFloat(y),
1131 a11,
1132 a21,
1133 a12,
1134 a22,
1135 temp;
1136
1137 rotation = parseFloat(rotation);
1138 skewX = parseFloat(skewX);
1139 skewY = parseFloat(skewY);
1140
1141 if (skewY) {
1142 //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees.
1143 skewY = parseFloat(skewY);
1144 skewX += skewY;
1145 rotation += skewY;
1146 }
1147
1148 if (rotation || skewX) {
1149 rotation *= _DEG2RAD;
1150 skewX *= _DEG2RAD;
1151 a11 = Math.cos(rotation) * scaleX;
1152 a21 = Math.sin(rotation) * scaleX;
1153 a12 = Math.sin(rotation - skewX) * -scaleY;
1154 a22 = Math.cos(rotation - skewX) * scaleY;
1155
1156 if (skewX) {
1157 skewY *= _DEG2RAD;
1158 temp = Math.tan(skewX - skewY);
1159 temp = Math.sqrt(1 + temp * temp);
1160 a12 *= temp;
1161 a22 *= temp;
1162
1163 if (skewY) {
1164 temp = Math.tan(skewY);
1165 temp = Math.sqrt(1 + temp * temp);
1166 a11 *= temp;
1167 a21 *= temp;
1168 }
1169 }

Callers

nothing calls this directly

Calls 2

_roundFunction · 0.90
_convertToUnitFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…