Merge pull request #128 from asajeffrey/demo-handle-events-before-scene-update

In the demo, handle events before updating the scene
This commit is contained in:
Patrick Walton 2019-04-10 08:42:33 -07:00 committed by GitHub
commit 12b3b1cd9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -185,12 +185,12 @@ impl<W> DemoApp<W> where W: Window {
}
pub fn prepare_frame(&mut self, events: Vec<Event>) -> u32 {
// Update the scene.
self.build_scene();
// Handle events.
let ui_events = self.handle_events(events);
// Update the scene.
self.build_scene();
// Get the render message, and determine how many scenes it contains.
let transforms = match self.scene_thread_proxy.receiver.recv().unwrap() {
SceneToMainMsg::BeginFrame { transforms } => transforms,