parent
2c9c5f0dea
commit
7d3d7ce0ca
|
|
@ -641,7 +641,7 @@ impl MenuState {
|
||||||
if let Some(sub_menu) = self.current_submenu() {
|
if let Some(sub_menu) = self.current_submenu() {
|
||||||
if let Some(pos) = pointer.hover_pos() {
|
if let Some(pos) = pointer.hover_pos() {
|
||||||
let rect = sub_menu.read().rect;
|
let rect = sub_menu.read().rect;
|
||||||
return rect.intesects_ray(pos, pointer.velocity().normalized());
|
return rect.intersects_ray(pos, pointer.velocity().normalized());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
|
|
||||||
|
|
@ -607,7 +607,7 @@ impl Rect {
|
||||||
|
|
||||||
impl Rect {
|
impl Rect {
|
||||||
/// Does this Rect intersect the given ray (where `d` is normalized)?
|
/// Does this Rect intersect the given ray (where `d` is normalized)?
|
||||||
pub fn intesects_ray(&self, o: Pos2, d: Vec2) -> bool {
|
pub fn intersects_ray(&self, o: Pos2, d: Vec2) -> bool {
|
||||||
let mut tmin = -f32::INFINITY;
|
let mut tmin = -f32::INFINITY;
|
||||||
let mut tmax = f32::INFINITY;
|
let mut tmax = f32::INFINITY;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue