fix bug where resizes pause the animations

This commit is contained in:
Emi Matchu 2020-09-22 05:14:31 -07:00
parent 30ec18e85e
commit 88f5c1f1aa

View file

@ -68,14 +68,14 @@ function OutfitCanvas({ children, width, height }) {
); );
}, []); }, []);
// When the canvas resizes, resize all the layers, then a single bulk update. // When the canvas resizes, resize all the layers.
React.useEffect(() => { React.useEffect(() => {
for (const handler of resizeListenersRef.current) { for (const handler of resizeListenersRef.current) {
handler(); handler();
} }
if (stage) { // NOTE: We don't bother firing an update, because we trust the ticker
stage.update(); // to do it on the next frame. (And, I don't understand why, but
} // updating here actually paused all movies! So, don't!)
}, [stage, width, height]); }, [stage, width, height]);
if (loading) { if (loading) {