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

Text is cut off in render_ui_to_texture example with high scale factors. #11375

Closed
rparrett opened this issue Jan 16, 2024 · 3 comments
Closed
Labels
A-Text Rendering and layout for characters A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior

Comments

@rparrett
Copy link
Contributor

rparrett commented Jan 16, 2024

Or perhaps a better title is "bevy_ui text rendering always uses the primary window's scale factor, even when rendering to a texture."

Bevy version

9f8db0d

Relevant system information

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 13.6.2 ", kernel: "22.6.0", cpu: "", core_count: "10", memory: "64.0 GiB" }

What you did

Have high DPI screen or override scale factor with

.add_plugins(DefaultPlugins.set(WindowPlugin {
    primary_window: Some(Window {
        resolution: WindowResolution::default().with_scale_factor_override(2.),
        ..default()
    }),
    ..default()
}))

cargo run --example render_ui_to_texture

What went wrong

Cube says This is a cu.

Screenshot 2024-01-16 at 3 39 35 PM

Additional information

Related issue: #5621

If it is true that we now generally support "window-independent ui scaling," then it looks like some code in bevy_ui needs to be updated:

// TODO: Support window-independent scaling: https://github.com/bevyengine/bevy/issues/5621
let window_scale_factor = windows
.get_single()
.map(|window| window.resolution.scale_factor())
.unwrap_or(1.);

If not, that issue may need to be reopened, and perhaps this one closed.

@rparrett rparrett added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets A-Text Rendering and layout for characters labels Jan 16, 2024
@nicoburns
Copy link
Contributor

As of #10559, this should probably be thought of as per-camera UI scaling rather than per-window UI scaling.

@rparrett
Copy link
Contributor Author

rparrett commented Jan 17, 2024

As far as I can tell, text_system was just missed in #10559.

@rparrett
Copy link
Contributor Author

This was fixed by #13697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Text Rendering and layout for characters A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants