Fix `debug_assert` triggered by `menu`/`intersect_ray` (#7299)
This commit is contained in:
parent
47a2bb10b0
commit
d94386de3d
|
|
@ -1465,7 +1465,10 @@ impl PointerState {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(pos) = self.hover_pos() {
|
if let Some(pos) = self.hover_pos() {
|
||||||
return rect.intersects_ray(pos, self.direction());
|
let dir = self.direction();
|
||||||
|
if dir != Vec2::ZERO {
|
||||||
|
return rect.intersects_ray(pos, self.direction());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -651,7 +651,7 @@ impl Rect {
|
||||||
pub fn intersects_ray(&self, o: Pos2, d: Vec2) -> bool {
|
pub fn intersects_ray(&self, o: Pos2, d: Vec2) -> bool {
|
||||||
debug_assert!(
|
debug_assert!(
|
||||||
d.is_normalized(),
|
d.is_normalized(),
|
||||||
"expected normalized direction, but `d` has length {}",
|
"Debug assert: expected normalized direction, but `d` has length {}",
|
||||||
d.length()
|
d.length()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue