Skip to content

Fix scaling for UI debug overlay #16669

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

Closed

Conversation

ickshonpe
Copy link
Contributor

Objective

Fixes #16666

Solution

Multiply the coordinates by the inverse of the window scale factor.

@ickshonpe ickshonpe added A-Dev-Tools Tools used to debug Bevy applications. A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 5, 2024
@alice-i-cecile alice-i-cecile added this to the 0.15.1 milestone Dec 6, 2024
@JeanMertz
Copy link
Contributor

I backported these changes to 0.15 in v0.15.0...JeanMertz:bevy:jean/debug-ui-gizmo-size, but I cannot get the debug lines to show up. The bevy-egui-inspector also doesn't show the entities being created to draw the lines.

Need to investigate what happened, but it might just be a mistake on my side, or the fact that this doesn't backport cleanly to 0.15.

@ickshonpe
Copy link
Contributor Author

ickshonpe commented Dec 6, 2024

I backported these changes to 0.15 in v0.15.0...JeanMertz:bevy:jean/debug-ui-gizmo-size, but I cannot get the debug lines to show up. The bevy-egui-inspector also doesn't show the entities being created to draw the lines.

Need to investigate what happened, but it might just be a mistake on my side, or the fact that this doesn't backport cleanly to 0.15.

So they worked on main without any problems for you?

I could rewrite the debug visualization to use the UI renderer. It should be simpler and it would work with multiple windows and render to texture etc.

@ickshonpe
Copy link
Contributor Author

UI renderer PR: #16693

@BenjaminBrienen BenjaminBrienen 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-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 23, 2024
@alice-i-cecile
Copy link
Member

@ickshonpe @mockersf I'd like to ship this for 0.15.1: what's the best approach now that #16693 is merged?

@alice-i-cecile alice-i-cecile added S-Needs-Design This issue requires design work to think about how it would best be accomplished and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Dec 24, 2024
@JeanMertz
Copy link
Contributor

JeanMertz commented Dec 24, 2024

@alice-i-cecile i don’t believe that implementation has the same issue. I backported the pr you linked to 0.15 and haven’t had any issues with it.

edit: or are you referring to the fact that that PR won’t be part of 0.15.1, so we still need this fix to land?

@alice-i-cecile
Copy link
Member

or are you referring to the fact that that PR won’t be part of 0.15.1, so we still need this fix to land?

Precisely: we don't want to ship the PR that this builds on into 0.15.1 because it's breaking. But it would still be good to have a simple fix for the issue.

@mockersf
Copy link
Member

mockersf commented Dec 26, 2024

It will probably have to be rewritten on the patch branch. I'll check how hard it is when cherrypicking this PR, and call for help if needed

@ickshonpe
Copy link
Contributor Author

ickshonpe commented Dec 26, 2024

The changes are really simple so I don't think there should be any problems.

@mockersf mockersf modified the milestones: 0.15.1, 0.15.2 Jan 3, 2025
@mockersf mockersf modified the milestones: 0.15.2, 0.15.3 Feb 6, 2025
@alice-i-cecile
Copy link
Member

I don't think this is impactful enough to spend the time backporting.

@mockersf mockersf removed this from the 0.15.3 milestone Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dev-Tools Tools used to debug Bevy applications. A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DebugUiPlugin doesn't respect scale factor properly
5 participants