summaryrefslogtreecommitdiffstats
path: root/examples/tour/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-09-05 21:17:23 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-09-05 21:17:23 +0200
commite6f9b5a16e0b529c4d4cacd6d07e47577403ae39 (patch)
tree7047ce26e681794bf606683dc9e5ba583569980c /examples/tour/main.rs
parent3838203dff120391282c45935ded456ba9d2884d (diff)
downloadiced-e6f9b5a16e0b529c4d4cacd6d07e47577403ae39.tar.gz
iced-e6f9b5a16e0b529c4d4cacd6d07e47577403ae39.tar.bz2
iced-e6f9b5a16e0b529c4d4cacd6d07e47577403ae39.zip
Set cursor type only when necessary in `tour`
Diffstat (limited to 'examples/tour/main.rs')
-rw-r--r--examples/tour/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/tour/main.rs b/examples/tour/main.rs
index 1a9ba362..571bc2e2 100644
--- a/examples/tour/main.rs
+++ b/examples/tour/main.rs
@@ -170,7 +170,11 @@ impl event::EventHandler for Game {
self.tour.update(message);
}
- mouse::set_cursor_type(context, into_cursor_type(cursor));
+ let cursor_type = into_cursor_type(cursor);
+
+ if mouse::cursor_type(context) != cursor_type {
+ mouse::set_cursor_type(context, cursor_type);
+ }
graphics::present(context)?;
Ok(())