Fix again
parent
e6512d83fa
commit
9eb528f993
|
@ -117,9 +117,11 @@ impl Planet {
|
|||
self.reflow(planet, state);
|
||||
}
|
||||
|
||||
self.button.step(input, state);
|
||||
self.landscape.step(input, state);
|
||||
self.frame.step(input, state);
|
||||
self.button
|
||||
.step(input, state, Some(self.frame.get_rect(input)));
|
||||
self.landscape
|
||||
.step(input, state, Some(self.frame.get_rect(input)));
|
||||
self.frame.step(input, state, None);
|
||||
|
||||
// Draw elements
|
||||
self.button
|
||||
|
|
|
@ -39,16 +39,14 @@ impl UiSprite {
|
|||
};
|
||||
}
|
||||
|
||||
pub fn step(&mut self, input: &RenderInput, state: &RenderState) {
|
||||
if self.contains_mouse(input, state, Some(self.get_rect(input)))
|
||||
pub fn step(&mut self, input: &RenderInput, state: &RenderState, parent: Option<SpriteRect>) {
|
||||
if self.contains_mouse(input, state, parent)
|
||||
&& !self.has_mouse
|
||||
&& self.on_mouse_enter.is_some()
|
||||
{
|
||||
self.has_mouse = true;
|
||||
self.anim.jump_to(input.ct, self.on_mouse_enter.unwrap())
|
||||
}
|
||||
|
||||
if !self.contains_mouse(input, state, Some(self.get_rect(input)))
|
||||
} else if !self.contains_mouse(input, state, parent)
|
||||
&& self.has_mouse
|
||||
&& self.on_mouse_leave.is_some()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue