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 | ||
| CHANGELOG.md | ||
| Cargo.toml | ||
| README.md | ||
README.md
epaint - egui paint library
A bare-bones 2D graphics library for turning simple 2D shapes and text into textured triangles.
Made for egui.