Take Event by reference in Widget::update
This commit is contained in:
parent
1b01d6718b
commit
afef368d8a
49 changed files with 111 additions and 155 deletions
|
|
@ -264,7 +264,7 @@ where
|
|||
fn update(
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
event: Event,
|
||||
event: &Event,
|
||||
_layout: Layout<'_>,
|
||||
_cursor: mouse::Cursor,
|
||||
_renderer: &Renderer,
|
||||
|
|
@ -278,7 +278,7 @@ where
|
|||
state.animation = state.animation.timed_transition(
|
||||
self.cycle_duration,
|
||||
self.rotation_duration,
|
||||
now,
|
||||
*now,
|
||||
);
|
||||
|
||||
state.cache.clear();
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ where
|
|||
fn update(
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
event: Event,
|
||||
event: &Event,
|
||||
_layout: Layout<'_>,
|
||||
_cursor: mouse::Cursor,
|
||||
_renderer: &Renderer,
|
||||
|
|
@ -189,7 +189,7 @@ where
|
|||
let state = tree.state.downcast_mut::<State>();
|
||||
|
||||
if let Event::Window(window::Event::RedrawRequested(now)) = event {
|
||||
*state = state.timed_transition(self.cycle_duration, now);
|
||||
*state = state.timed_transition(self.cycle_duration, *now);
|
||||
|
||||
shell.request_redraw();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue