forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix screenshot example (bevyengine#15094)
# Objective I noticed some issues in `screenshot` example: 1. Cursor icon won't return from `SystemCursorIcon::Progress` to default icon, even though screen shot saving is done. 2. Panics when exiting window: ``called `Result::unwrap()` on an `Err` value: NoEntities("bevy_ecs::query::state::QueryState<bevy_ecs::entity::Entity, bevy_ecs::query::filter::With<bevy_window::window::Window>>")`` ## Solution 1. Caused by cursor updating system not responding to [`CursorIcon` component removal](https://github.com/bevyengine/bevy/blob/5cfcbf47ed386515adefe80f99f8e8f7e7f3ce5a/examples/window/screenshot.rs#L38). I believe it should, so change it to react to `RemovedComponents<CursorIcon>`. (a suggestion) 2. Use `get_single` for window. ## Testing - run screenshot example --------- Co-authored-by: Alice Cecile <[email protected]>
- Loading branch information
1 parent
adc2cf7
commit bafffe1
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters