-
Notifications
You must be signed in to change notification settings - Fork 227
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When alphaTab is initialized it performs internally a rendering of an empty music sheet. This empty rendering fires all the renderFinished and postRenderFinished events. This leads to issues like
CoderLine/alphaTabWebsite#33
Potentially also #810 is related.
Expected Behavior
The render events should not be fired for the empty initial render.
Steps To Reproduce
- Create a new AlphaTabApi
- Register for the postRenderFinished event afterwards
- Call afterwards the renderTracks function
- Notice the postRenderFinished being called once for the empty rendering, and then when actually the sheet was rendered.
Link to jsFiddle, CodePen, Project
No response
Found in Version
1.3-alpha
Platform
Web
Environment
- **OS**: Win11
- **Browser**: Chrome 94.0.4606.61Anything else?
This issue was likely introduced in 1.3 when I fixed some issues that you could not clear the rendered score. Nowadays you can call the render functions with empty values to clear the rendered sheet. In such cases the events should still be fired.
But on the initialization this should not happen. Easiest way might be a flag which remembers whether there was really an initial render of a score requested and fire the render events only then.