summaryrefslogtreecommitdiffstats
path: root/winit/src/application.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-08-02 17:34:04 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-08-02 17:34:04 +0200
commit54ad92ce913629d1d1f623f4b14d51244554a59c (patch)
tree6847409152a9acec83d2c98dee30046267c68a9e /winit/src/application.rs
parent77c6864e7c772c5e228bc09fe40c2c0b8884386d (diff)
downloadiced-54ad92ce913629d1d1f623f4b14d51244554a59c.tar.gz
iced-54ad92ce913629d1d1f623f4b14d51244554a59c.tar.bz2
iced-54ad92ce913629d1d1f623f4b14d51244554a59c.zip
Build `UserInterface` only once on `Outcome::Chain`
Diffstat (limited to 'winit/src/application.rs')
-rw-r--r--winit/src/application.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 3d58da0f..3a5c3dac 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -662,17 +662,16 @@ pub fn run_command<A, E>(
let mut current_cache = std::mem::take(cache);
let mut current_operation = Some(action.into_operation());
- while let Some(mut operation) = current_operation.take() {
- let mut user_interface = build_user_interface(
- application,
- current_cache,
- renderer,
- state.logical_size(),
- debug,
- );
+ let mut user_interface = build_user_interface(
+ application,
+ current_cache,
+ renderer,
+ state.logical_size(),
+ debug,
+ );
+ while let Some(mut operation) = current_operation.take() {
user_interface.operate(renderer, operation.as_mut());
- current_cache = user_interface.into_cache();
match operation.finish() {
operation::Outcome::None => {}
@@ -687,6 +686,7 @@ pub fn run_command<A, E>(
}
}
+ current_cache = user_interface.into_cache();
*cache = current_cache;
}
}