Capítulo 165 de 411
An unofficial helper that reproduces GSAP 2's old skewType: "compensated" rendering behavior in GSAP 3, which visually adjusts scaleX/scaleY to counteract the distortion skewing normally introduces.
onUpdate, not a config option — GSAP 3 doesn't have a built-in skewType anymore._gsap cache's scaleX/scaleY before calling renderTransform().function compensatedSkew() {
var targets = this.targets(), i = targets.length, DEG2RAD = Math.PI / 180,
target, scaleY, scaleX, cache;
while (i--) {
target = targets[i];
cache = target._gsap;
scaleY = cache.scaleY; scaleX = cache.scaleX;
cache.scaleY *= Math.cos(parseFloat(cache.skewX) * DEG2RAD);
cache.scaleX *= Math.cos(parseFloat(cache.skewY) * DEG2RAD);
cache.renderTransform(1, cache);
cache.scaleY = scaleY; cache.scaleX = scaleX;
}
}
gsap.set(target, { skewX: -30, onUpdate: compensatedSkew });
onUpdate to post-process a tween's rendered transform every frame._gsap cache) and isn't officially supported, so it can break across GSAP versions.