Skip to content
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

Fix bevy_ui compile error when bevy_picking feature is disabled #15053

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

BigWingBeat
Copy link
Contributor

Objective

#14957 added the pick_rounded_rect function to bevy_ui in the picking_backend module, which is gated behind the bevy_picking feature. This function is used in that module, as well as in the focus module. The latter usage is not gated behind the bevy_picking feature, causing a compile error when the feature is disabled.

Solution

Move the pick_rounded_rect function out of the picking_backend module, as it does not depend on anything defined in that module. I put it in lib.rs but it could reasonably be moved somewhere else instead.

Testing

Encountered this compile error in a project and confirmed that this patch fixes it.

@IQuick143 IQuick143 added A-UI Graphical user interfaces, styles, layouts, and widgets P-Compile-Failure A failure to compile Bevy apps S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Picking Pointing at and selecting objects of all sorts labels Sep 5, 2024
Copy link
Contributor

@ickshonpe ickshonpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually thought about moving pick_rounded_rect to focus when I was finishing up the PR but it didn't seem to matter and I didn't realise the whole picking_backend module was behind a feature 😅 .

Changes look good.

crates/bevy_ui/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seconding the request to move pick_rounded_rect, but once that's done I'm happy to approve and merge :)

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 5, 2024
@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Sep 5, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 5, 2024
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Sep 5, 2024
Merged via the queue into bevyengine:main with commit 54aa45e Sep 5, 2024
27 checks passed
BD103 pushed a commit to BD103/bevy that referenced this pull request Sep 9, 2024
…evyengine#15053)

# Objective

bevyengine#14957 added the `pick_rounded_rect` function to `bevy_ui` in the
`picking_backend` module, which is gated behind the `bevy_picking`
feature. This function is used in that module, as well as in the `focus`
module. The latter usage is not gated behind the `bevy_picking` feature,
causing a compile error when the feature is disabled.

## Solution

Move the `pick_rounded_rect` function out of the `picking_backend`
module, as it does not depend on anything defined in that module. I put
it in `lib.rs` but it could reasonably be moved somewhere else instead.

## Testing

Encountered this compile error in a project and confirmed that this
patch fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Picking Pointing at and selecting objects of all sorts A-UI Graphical user interfaces, styles, layouts, and widgets P-Compile-Failure A failure to compile Bevy apps S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants