Fix windows not being centered properly when system interface is scaled (#8903)
# Objective Fixes #8765 ## Solution When windows are created during plugin setup, the scale_factor of a WindowResolution struct will always be 1.0 (default). The correct scale factor is set later in flow. To get correct center calculations use the monitors scale factor directly instead. ## Results System: Windows 10 Pro (125% scaling) ### main  ### This PR 
This commit is contained in:
parent
f4fec7b83d
commit
98eb1d56c2
@ -345,7 +345,9 @@ pub fn winit_window_position(
|
|||||||
if let Some(monitor) = maybe_monitor {
|
if let Some(monitor) = maybe_monitor {
|
||||||
let screen_size = monitor.size();
|
let screen_size = monitor.size();
|
||||||
|
|
||||||
let scale_factor = resolution.base_scale_factor();
|
// We use the monitors scale factor here since WindowResolution.scale_factor
|
||||||
|
// is not yet populated when windows are created at plugin setup
|
||||||
|
let scale_factor = monitor.scale_factor();
|
||||||
|
|
||||||
// Logical to physical window size
|
// Logical to physical window size
|
||||||
let (width, height): (u32, u32) =
|
let (width, height): (u32, u32) =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user