move event data out of widgetdata
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user