Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where composite: replace did not replace previous effects
Consider a set of effects: e.animate([{ "width": "0" }, { "width": "5px" }], { duration: 100 }); e.animate([{ "width": "0" }, { "width": "5px" }], { duration: 100, composite: 'add' }); e.animate([{ "width": "0" }, { "width": "2px" }], { duration: 100 }); e.animate([{ "width": "0" }, { "width": "2px" }], { duration: 100, composite: 'add' }); Previously the code in CopyToActiveInterpolationsMap would incorrectly move the third effect to the start of the list to replace the original keyframe pair, resulting in an effect stack of: { "width": "0" }, { "width": "2px" } { "width": "0" }, { "width": "5px" } { "width": "0" }, { "width": "2px" } This is wrong; not only has it retained an effect it shouldn't have, it has also re-ordered keyframes which might break non-commutative additive properties. This CL fixes the logic to properly clear out existing effects when a composite: 'replace' effect is put onto the stack. Bug: 992378 Change-Id: I94ae54429ac7d4d28a0702d397ab64c2e45dee65 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746302 Commit-Queue: Stephen McGruer <[email protected]> Reviewed-by: Yi Gu <[email protected]> Cr-Commit-Position: refs/heads/master@{#686024}
- Loading branch information