mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Run a frame per queued event in egui_kittest (#5704)
This should fix the remaining problems with the modifiers * [x] I have followed the instructions in the PR template
This commit is contained in:
@@ -219,17 +219,22 @@ impl<'a, State> Harness<'a, State> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Run a frame.
|
||||
/// This will call the app closure with the queued events and current context and
|
||||
/// Run a frame for each queued event (or a single frame if there are no events).
|
||||
/// This will call the app closure with each queued event and
|
||||
/// update the Harness.
|
||||
pub fn step(&mut self) {
|
||||
self._step(false);
|
||||
let events = self.kittest.take_events();
|
||||
if events.is_empty() {
|
||||
self._step(false);
|
||||
}
|
||||
for event in events {
|
||||
self.event_state.update(event, &mut self.input);
|
||||
self._step(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// Run a single step. This will not process any events.
|
||||
fn _step(&mut self, sizing_pass: bool) {
|
||||
self.event_state
|
||||
.update(self.kittest.take_events(), &mut self.input);
|
||||
|
||||
self.input.predicted_dt = self.step_dt;
|
||||
|
||||
let mut output = self.ctx.run(self.input.take(), |ctx| {
|
||||
|
||||
Reference in New Issue
Block a user