-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-TextRendering and layout for charactersRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
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
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.
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:
bevy/crates/bevy_ui/src/widget/text.rs
Lines 234 to 238 in 39cca41
| // 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.
Metadata
Metadata
Assignees
Labels
A-TextRendering and layout for charactersRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior