fix: avoid crash on update_cursor_icon (#7)
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fixed so that webview can detect pointers correctly even if it is not the root entity.
|
||||
- Fixed so that the webview can detect pointers correctly even if it is not the root entity.
|
||||
- Avoid a crash when updating the cursor icon
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
|
||||
@@ -22,17 +22,15 @@ pub(crate) struct SystemCursorIconSender(Sender<SystemCursorIcon>);
|
||||
pub(crate) struct SystemCursorIconReceiver(pub(crate) Receiver<SystemCursorIcon>);
|
||||
|
||||
fn update_cursor_icon(
|
||||
par_commands: ParallelCommands,
|
||||
mut commands: Commands,
|
||||
cursor_icon_receiver: Res<SystemCursorIconReceiver>,
|
||||
windows: Query<Entity>,
|
||||
) {
|
||||
while let Ok(cursor_icon) = cursor_icon_receiver.0.try_recv() {
|
||||
windows.par_iter().for_each(|window| {
|
||||
par_commands.command_scope(|mut commands| {
|
||||
windows.iter().for_each(|window| {
|
||||
commands
|
||||
.entity(window)
|
||||
.insert(CursorIcon::System(cursor_icon));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user