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

[Merged by Bors] - Update layout/style when scale factor changes too #4689

Closed
wants to merge 4 commits into from

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented May 7, 2022

Objective

Solution

if let Ok((text, bounds, mut calculated_size)) = query.get_mut(entity) {
let text_bounds = match bounds {
for (entity, text_changed, text, maybe_bounds, mut calculated_size) in text_query.iter_mut() {
if factor_changed || text_changed || queue.entities.remove(&entity) {
Copy link
Member Author

Choose a reason for hiding this comment

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

queue.entities.remove might look expensive, but the other changes more than drown out this overhead.

@DJMcNab DJMcNab added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change labels May 7, 2022
Copy link
Contributor

@tim-blackbird tim-blackbird left a comment

Choose a reason for hiding this comment

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

Looks good to me. besides that struct used for the local.
I can't test if this works as my distro does not support different scaling per monitor or updating the scaling without restarting :/

crates/bevy_text/src/text2d.rs Outdated Show resolved Hide resolved
crates/bevy_text/src/text2d.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@tim-blackbird tim-blackbird left a comment

Choose a reason for hiding this comment

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

Neat. I like the comment you added.
Although I find the line break a bit awkward, but I won't block on that.

crates/bevy_text/src/text2d.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

I tested the example of the linked issue and this solution worked as expected.

@IceSentry IceSentry added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 8, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request May 9, 2022
# Objective

- Fix #4688

## Solution

- Fixes #4688
- This raises an interesting question about our change detection system - is filtered queries actually a good UX for this? They're ergonomic in the easy case, but what do we recommend when it's not so.
- In this case, the system should have been migrated similary to #4180 anyway, so I've done that.
@bors
Copy link
Contributor

bors bot commented May 9, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request May 9, 2022
# Objective

- Fix #4688

## Solution

- Fixes #4688
- This raises an interesting question about our change detection system - is filtered queries actually a good UX for this? They're ergonomic in the easy case, but what do we recommend when it's not so.
- In this case, the system should have been migrated similary to #4180 anyway, so I've done that.
@bors bors bot changed the title Update layout/style when scale factor changes too [Merged by Bors] - Update layout/style when scale factor changes too May 9, 2022
@bors bors bot closed this May 9, 2022
@DJMcNab DJMcNab deleted the text_scale_factor branch May 9, 2022 16:08
robtfm pushed a commit to robtfm/bevy that referenced this pull request May 10, 2022
# Objective

- Fix bevyengine#4688

## Solution

- Fixes bevyengine#4688
- This raises an interesting question about our change detection system - is filtered queries actually a good UX for this? They're ergonomic in the easy case, but what do we recommend when it's not so.
- In this case, the system should have been migrated similary to bevyengine#4180 anyway, so I've done that.
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
# Objective

- Fix bevyengine#4688

## Solution

- Fixes bevyengine#4688
- This raises an interesting question about our change detection system - is filtered queries actually a good UX for this? They're ergonomic in the easy case, but what do we recommend when it's not so.
- In this case, the system should have been migrated similary to bevyengine#4180 anyway, so I've done that.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- Fix bevyengine#4688

## Solution

- Fixes bevyengine#4688
- This raises an interesting question about our change detection system - is filtered queries actually a good UX for this? They're ergonomic in the easy case, but what do we recommend when it's not so.
- In this case, the system should have been migrated similary to bevyengine#4180 anyway, so I've done that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change 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.

Desktop scale change does not update text
4 participants