Skip to content

Commit 9cf1a1a

Browse files
authored
Remove unused query param (#18924)
# Objective Was copying off `bevy_ui`'s homework writing a picking backend and noticed the `Has<IsDefaultPickingCamera>` is not used anywhere. ## Testing Ran a random example. This shouldn't cause any behavioral changes at all because the component/archetype access/filter flags should be the same. `Has<X>` doesn't affect access since it doesn't actually read or write anything, and it doesn't affect matched archetypes either. Can't think of another reason any behavior would change.
1 parent 26f0ce2 commit 9cf1a1a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

crates/bevy_ui/src/picking_backend.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,7 @@ pub struct NodeQuery {
104104
/// we need for determining picking.
105105
pub fn ui_picking(
106106
pointers: Query<(&PointerId, &PointerLocation)>,
107-
camera_query: Query<(
108-
Entity,
109-
&Camera,
110-
Has<IsDefaultUiCamera>,
111-
Has<UiPickingCamera>,
112-
)>,
107+
camera_query: Query<(Entity, &Camera, Has<UiPickingCamera>)>,
113108
primary_window: Query<Entity, With<PrimaryWindow>>,
114109
settings: Res<UiPickingSettings>,
115110
ui_stack: Res<UiStack>,
@@ -128,8 +123,8 @@ pub fn ui_picking(
128123
// cameras. We want to ensure we return all cameras with a matching target.
129124
for camera in camera_query
130125
.iter()
131-
.filter(|(_, _, _, cam_can_pick)| !settings.require_markers || *cam_can_pick)
132-
.map(|(entity, camera, _, _)| {
126+
.filter(|(_, _, cam_can_pick)| !settings.require_markers || *cam_can_pick)
127+
.map(|(entity, camera, _)| {
133128
(
134129
entity,
135130
camera.target.normalize(primary_window.single().ok()),
@@ -139,7 +134,7 @@ pub fn ui_picking(
139134
.filter(|(_entity, target)| target == &pointer_location.target)
140135
.map(|(cam_entity, _target)| cam_entity)
141136
{
142-
let Ok((_, camera_data, _, _)) = camera_query.get(camera) else {
137+
let Ok((_, camera_data, _)) = camera_query.get(camera) else {
143138
continue;
144139
};
145140
let mut pointer_pos =
@@ -260,7 +255,7 @@ pub fn ui_picking(
260255

261256
let order = camera_query
262257
.get(*camera)
263-
.map(|(_, cam, _, _)| cam.order)
258+
.map(|(_, cam, _)| cam.order)
264259
.unwrap_or_default() as f32
265260
+ 0.5; // bevy ui can run on any camera, it's a special case
266261

0 commit comments

Comments
 (0)