move event data out of widgetdata

This commit is contained in:
2025-12-23 15:42:04 -05:00
parent 54534c4c34
commit 462c0e6416
7 changed files with 24 additions and 29 deletions

View File

@@ -80,9 +80,8 @@ impl<'a> DrawState<'a> {
pub fn redraw_all(&mut self) {
// free all resources & cache
for (id, active) in self.ui.active.drain() {
let data = self.ui.widgets.data(id).unwrap();
self.events.undraw(data, &active);
for (_, active) in self.ui.active.drain() {
self.events.undraw(&active);
}
self.ui.cache.clear();
self.ui.free(self.events);
@@ -170,8 +169,7 @@ impl<'a> DrawState<'a> {
}
// update modules
let data = self.ui.widgets.data(id).unwrap();
self.events.draw(data, &active);
self.events.draw(&active);
self.active.insert(id, active);
}
@@ -202,8 +200,7 @@ impl<'a> DrawState<'a> {
active.textures.clear();
self.textures.free();
if undraw {
let data = self.ui.widgets.data(id).unwrap();
self.events.undraw(data, active);
self.events.undraw(active);
}
}
active