summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-12 04:35:41 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-12 04:35:41 +0100
commit0b86c4a299d384cafca31206eac8c94f1123518d (patch)
tree6101ee28b8f030963bcc0f0cc7c51e67076fcf72 /examples
parentc649ec8cf7066eb190193ff499c0ecccbca76796 (diff)
downloadiced-0b86c4a299d384cafca31206eac8c94f1123518d.tar.gz
iced-0b86c4a299d384cafca31206eac8c94f1123518d.tar.bz2
iced-0b86c4a299d384cafca31206eac8c94f1123518d.zip
Implement `window::frames` subscription
... and use it in the `solar_system` example :tada:
Diffstat (limited to 'examples')
-rw-r--r--examples/solar_system/src/main.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 9e303576..9a4ee754 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -9,7 +9,6 @@
use iced::application;
use iced::executor;
use iced::theme::{self, Theme};
-use iced::time;
use iced::widget::canvas;
use iced::widget::canvas::gradient::{self, Gradient};
use iced::widget::canvas::stroke::{self, Stroke};
@@ -90,7 +89,7 @@ impl Application for SolarSystem {
}
fn subscription(&self) -> Subscription<Message> {
- time::every(time::Duration::from_millis(10)).map(Message::Tick)
+ window::frames().map(Message::Tick)
}
}