summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor <hector@hecrj.dev>2025-02-04 01:38:24 +0100
committerLibravatar GitHub <noreply@github.com>2025-02-04 01:38:24 +0100
commit782b96b52f59dcde75bfa9d4affc8852e635e781 (patch)
treebb8b73b57c0c9b3a1677d8ba199dbed5e20eaac5 /examples/game_of_life/src/main.rs
parent3f509c6d0e8aeeeb69b384df0665cbb7e6b6c663 (diff)
parentafef368d8a920c7702048d3b1604b2046fe46ff8 (diff)
downloadiced-782b96b52f59dcde75bfa9d4affc8852e635e781.tar.gz
iced-782b96b52f59dcde75bfa9d4affc8852e635e781.tar.bz2
iced-782b96b52f59dcde75bfa9d4affc8852e635e781.zip
Merge pull request #2781 from iced-rs/event-by-reference
Take `Event` by reference in `Widget::update`
Diffstat (limited to 'examples/game_of_life/src/main.rs')
-rw-r--r--examples/game_of_life/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index 1008e477..dec3df7f 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -380,7 +380,7 @@ mod grid {
fn update(
&self,
interaction: &mut Interaction,
- event: Event,
+ event: &Event,
bounds: Rectangle,
cursor: mouse::Cursor,
) -> Option<canvas::Action<Message>> {
@@ -471,7 +471,7 @@ mod grid {
_ => action.and_capture(),
})
}
- mouse::Event::WheelScrolled { delta } => match delta {
+ mouse::Event::WheelScrolled { delta } => match *delta {
mouse::ScrollDelta::Lines { y, .. }
| mouse::ScrollDelta::Pixels { y, .. } => {
if y < 0.0 && self.scaling > Self::MIN_SCALING