Fix wasm compilation/rendering#1079
Conversation
|
LGTM |
| #[cfg(target_arch = "wasm32")] | ||
| let renderer_ready = true; |
There was a problem hiding this comment.
Can you speak to the accuracy of doing this. Is this always true?
There was a problem hiding this comment.
During testing I noticed that when setting render_ready to always true the paint_state was in pending for some cycles and then got to initialized. Without, the paint_state was always stuck in pending. While looking at it again now, I suspect the actual reason might be because the last_presented_at only gets set inside the condition. So when renderer_ready is false render_frame gets called without any/very low delay in between thus preventing the initialization. To confirm, I moved the self.last_presented_at = Instant::now(); outside of the condition and with that it also works with the original renderer_ready flag. Maybe that would be the better fix instead?
|
Thanks for doing this! Just one question |
Thank you for this great UI library! While trying it out in a WASM environment I found and fixed some small issues:
muda::Menu,std::time::Instant)self.paint_statenot getting set toInitializedwithout paint calledwebgpuexample -> Manually set thefont_familyto "Fira Sans"