- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.2k
Closed
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleA new feature, making something new possible
Description
A window created using the following code has correct size in physical pixels, however it doesn't respect UI scaling, so it looks small on devices with scale factor different from 1.0:
use bevy::prelude::*;
use bevy_window::WindowMode;
fn main() {
    App::build()
        .add_resource(WindowDescriptor {
            title: "I am a window!".to_string(),
            width: 800,
            height: 600,
            vsync: true,
            resizable: true,
            ..Default::default()
        })
        .add_default_plugins()
        .run();
}Changing this line:
| .with_inner_size(winit::dpi::PhysicalSize::new(window.width, window.height)) | 
.with_inner_size(winit::dpi::LogicalSize::new(window.width, window.height))seems to help: see the screenshot below — both windows are created on MacBook Pro 13'' (with physical resolution 2560×1600 scaled to 1440×900) by running the code above, but window on the left was created before the change, and window on the right after the change:
I am not sure which behavior is “correct”, but it seems reasonable that it should be at least configurable.
berkus, Waridley, stefee and cedeber
Metadata
Metadata
Assignees
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleA new feature, making something new possible
