mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-25 08:28:42 -06:00
drain remaining signals
This commit is contained in:
parent
de9f41c296
commit
509d39ddea
|
@ -153,6 +153,9 @@ impl UiInstance {
|
|||
//first, drain and process the event queue
|
||||
self.input.update_state(&mut self.events);
|
||||
|
||||
//then, reset the (remaining) signals
|
||||
self.signal.clear();
|
||||
|
||||
//then, reset the draw commands
|
||||
std::mem::swap(&mut self.prev_draw_commands, &mut self.draw_commands);
|
||||
self.draw_commands.commands.clear();
|
||||
|
|
|
@ -46,4 +46,10 @@ impl SignalStore {
|
|||
.drain(..)
|
||||
.map(|x| *x.downcast::<T>().unwrap()) //unchecked?
|
||||
}
|
||||
|
||||
/// Clear all signals
|
||||
pub(crate) fn clear(&mut self) {
|
||||
//XXX: should we clear the vecs instead?
|
||||
self.sig.clear();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue