blueberrymuffin3 / osu-js

https://osu-js.pages.dev
MIT License
2 stars 1 forks source link

Super weird bug in slider path rendering #62

Closed kionell closed 2 years ago

kionell commented 2 years ago

I'm currently working on something big and i can't finish it because of one bug that's bothering me. This happens with EVERY slider and at first glance is not noticeable at all. At the very beginning of the slider, when it is just starting to fade in, the path appears in the wrong place literally for 1-2 frames.

image image image

And after that, the slider itself starts drawing the path, but skipping that piece, which appeared at the beginning by 1-2 frames. image

Slider path sprite with alpha locked to 1: image

blueberrymuffin3 commented 2 years ago

The position of the SliderPathSprite is set here: https://github.com/blueberrymuffin3/osu-js/blob/602cbafaae93950b88655cdd4e792a89358c811d/src/play/render/standard/components/slider_path.ts#L172-L174

It appears that the texture modification is processed immediately, while the position modification is deferred until the next frame. The transform matrices of each display object are calculated before the _render function is called, since you're not really supposed to modify anything in the render function.

I'm working on a fix RN.