Skip to content

Commit

Permalink
Don't panic when not exactly one camera (#71)
Browse files Browse the repository at this point in the history
* No camera is fine

* version bump :)

* edit error note

---------

Co-authored-by: Matthew <[email protected]>
  • Loading branch information
aevyrie and mwbryant authored Jun 21, 2024
1 parent ff4bd2a commit 2d9dfdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_transform_gizmo"
version = "0.11.0"
version = "0.11.1"
authors = [
"Aevyrie Roessler <[email protected]>",
"Foresight Mining Software Corporation",
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,10 @@ fn hover_gizmo(
mut hits: EventWriter<PointerHits>,
) {
for (gizmo_entity, children, mut gizmo, mut interaction, _transform) in gizmo_query.iter_mut() {
let (camera, gizmo_raycast_source) = gizmo_raycast_source
.get_single()
.expect("Missing gizmo raycast source");
let Ok((camera, gizmo_raycast_source)) = gizmo_raycast_source.get_single() else {
warn!("There must be exactly one gizmo raycast source");
return;
};

if let Some((topmost_gizmo_entity, _)) = gizmo_raycast_source.get_nearest_intersection() {
// Only update the gizmo state if it isn't being clicked (dragged) currently.
Expand Down

0 comments on commit 2d9dfdb

Please sign in to comment.