Skip to content

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

Closed
DJMcNab wants to merge 4 commits intobevyengine:mainfrom
DJMcNab:text_scale_factor
Closed

[Merged by Bors] - Update layout/style when scale factor changes too#4689
DJMcNab wants to merge 4 commits intobevyengine:mainfrom
DJMcNab:text_scale_factor

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 :/

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.

Co-authored-by: devil ira <JustTheCoolDude@gmail.com>
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