Skip to content

Fix text2d not getting scale factor after window creation#10449

Closed
rparrett wants to merge 1 commit into
bevyengine:mainfrom
rparrett:text2d-scale-factor-fix
Closed

Fix text2d not getting scale factor after window creation#10449
rparrett wants to merge 1 commit into
bevyengine:mainfrom
rparrett:text2d-scale-factor-fix

Conversation

@rparrett

@rparrett rparrett commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

Objective

Fixes #10407

Solution

This adds a local to keep track of the scale factor, which may or may not be a default value due to the lack of a window. Something similar is being done in text_system for UI.

I also explored using window.is_added, but the scale factor doesn't seem to be available on the same frame where that is true.

There may be some other more elegant solution -- I don't really understand #9826 where this broke.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in labels Nov 8, 2023
@alice-i-cecile alice-i-cecile added this to the 0.12.1 milestone Nov 8, 2023
@rparrett

rparrett commented Nov 9, 2023

Copy link
Copy Markdown
Contributor Author

This fixes the issue for this example, but I believe the bug is more far-reaching than this. So this probably isn't the right solution.

@rparrett rparrett closed this Nov 9, 2023
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 A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text2D placement and size are wrong (window scale factor)

2 participants