简体   繁体   English

Chrome 75,打破变换起源动画

[英]Chrome 75, break transform-origin animation

I found possible issue(or may be it is feature =)) in chrome 75 version.我在 chrome 75 版本中发现了可能的问题(或者可能是功能 =))。 Changes of transform origin during of transform animation doesn't affect on animation.变换动画期间变换原点的变化不影响动画。 I attached snipet which contains two loops, one changed transform, another changed transform origin.我附上了包含两个循环的 snipet,一个改变了变换,另一个改变了变换原点。

For example:例如: 在此处输入图片说明

In changelog for 75 version I found this commit which probably related to this issue: commit在 75 版本的变更日志中,我发现这个提交可能与这个问题有关: commit

 const div = document.getElementById('div'); const stat1 = document.getElementById('stat1'); const stat2 = document.getElementById('stat2'); // change transform (function loop(x = true) { requestAnimationFrame(() => { div.style.transform = x ? 'scale(2)' : 'scale(1)'; stat1.innerText = div.style.transform; stat2.innerText = div.style.transformOrigin; }); setTimeout(loop, 2000, !x); })(); // change transform origin (function loop2(x = 0, d = true) { div.style.transformOrigin = `${x}% ${x}%`; stat3.innerText = div.style.transformOrigin; const xx = x + (d ? 1 : -1); setTimeout(loop2, 100, xx, xx > 0 && xx < 100 ? d : !d); })();
 #div { transform: scale(1); transition: transform 4s ease 0s; } /* not important */ #div { background: green; opacity: 0.5; } #div2 { background: grey; color: white; text-align: center; } #div, #div2 { position: absolute; top: 80px; left: 80px; width: 80px; height: 80px; }
 <div id="div2"> <span id="stat1"></span><br/> <span id="stat2"></span><br/> <span id="stat3"></span> </div> <div id="div"></div>

We recently found that this problem was gone.我们最近发现这个问题消失了。 At least since 90.0.4430.85至少从 90.0.4430.85 开始

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM