summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-29 20:58:59 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-29 20:58:59 +0200
commit5d12e194f45b4a01034f3f52fae16c10bc0192dd (patch)
treeb2f566770daa8cf0206c92328b8b31074a79b8ab /examples/game_of_life
parent70f86f998b6db102d5b77f756750414efd53aa9e (diff)
downloadiced-5d12e194f45b4a01034f3f52fae16c10bc0192dd.tar.gz
iced-5d12e194f45b4a01034f3f52fae16c10bc0192dd.tar.bz2
iced-5d12e194f45b4a01034f3f52fae16c10bc0192dd.zip
Rename `Cursor::*_position` methods in `canvas`
Diffstat (limited to 'examples/game_of_life')
-rw-r--r--examples/game_of_life/src/main.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index 3e6848df..a2628594 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -298,7 +298,7 @@ mod grid {
self.mouse_pressed = state == ButtonState::Pressed;
}
- let cursor_position = cursor.internal_position(&bounds)?;
+ let cursor_position = cursor.position_in(&bounds)?;
let region = self.region(bounds.size());
let (i, j) = self.cell_at(region, cursor_position)?;
@@ -365,8 +365,7 @@ mod grid {
frame.translate(Vector::new(region.x, region.y));
frame.scale(region.width / SIZE as f32);
- if let Some(cursor_position) = cursor.internal_position(&bounds)
- {
+ if let Some(cursor_position) = cursor.position_in(&bounds) {
if let Some((i, j)) = self.cell_at(region, cursor_position)
{
let interaction = Path::rectangle(
@@ -397,7 +396,7 @@ mod grid {
) -> MouseCursor {
let region = self.region(bounds.size());
- match cursor.internal_position(&bounds) {
+ match cursor.position_in(&bounds) {
Some(position) if region.contains(position) => {
MouseCursor::Crosshair
}