8000 Fix `debug_assert` triggered by `menu`/`intersect_ray` by emilk · Pull Request #7299 · emilk/egui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix debug_assert triggered by menu/intersect_ray #7299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/egui/src/input_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,10 @@ impl PointerState {
}

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
}
Expand Down
2 changes: 1 addition & 1 deletion crates/emath/src/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ impl Rect {
pub fn intersects_ray(&self, o: Pos2, d: Vec2) -> bool {
debug_assert!(
d.is_normalized(),
"expected normalized direction, but `d` has length {}",
"Debug assert: expected normalized direction, but `d` has length {}",
d.length()
);

Expand Down
Loading
0