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