Dimchikkk / bevy_cosmic_edit

Apache License 2.0
87 stars 10 forks source link

noticeable lag between buffer spawn and fill color application #144

Open databasedav opened 5 months ago

databasedav commented 5 months ago

repro by adding fill_color: CosmicBackgroundColor(Color::DARK_GRAY) to the basic_ui example, the window flashes from white to grey, even in release mode

i'd like to address this but need some guidance, how can i synchronize the spawn and the fill?

Dimchikkk commented 5 months ago

Ping @bytemunch :)

databasedav commented 5 months ago

simply calling buffer.draw after construction of the CosmicEditBundle does not seem to suffice

Dimchikkk commented 5 months ago

@databasedav trying to reproduce the issue... basically I added:

image

no noticeable lag even in debug mode (I am on M1 Pro)

bytemunch commented 5 months ago

I can reproduce, got a white flash on setting fill_color to both DARK_GRAY and NONE, so can assume it breaks on all fill colors.

Will be an issue somewhere in the instantiation of the target sprite, I think it has a frame of blank before it's drawn to. May be able to fix by removing the funky sprite making and swapping steps, there's probably a much more ergonomic way of adding the target sprite to the entity.

https://github.com/Dimchikkk/bevy_cosmic_edit/assets/43527203/73f22e8d-d07f-417d-84c4-0d1e42f92dc1

White flash with fill_color set, 3x in a row

Looks like it's more than one frame, maybe two or three.