![]() This refactors the widget state storage introduced by @optozorax in https://github.com/emilk/egui/pull/257 * Unify the four buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `data`. * Less complexity, and also less chance of error (storing in one bucket, reading from another). * Store data by `Id` and `TypeId`. * Users can thus reuse the same `Id` to store many types. * Uses a simple xor of id and typeid, which is fast and good since both id and typeid are already high-entropy hashes. * Use different suffixes on the functions to pick if you want the data persisted or not (`get_temp`, `insert_persisted`, etc). * Writing with one suffix and reading with the other works. * To store state not bound to a specific `Id` (i.e. only based on type), use the new `Id::null` as the key. |
||
---|---|---|
.. | ||
fonts | ||
src | ||
Cargo.toml | ||
CHANGELOG.md | ||
README.md |