Fix eframe centering on multiple monitor systems (#4919)
On multiple-monitor systems, eframe was incorrectly selecting first ones dimensions for centering Would also appretiate releasing 0.28.2 with fix included on crates.io
This commit is contained in:
parent
0513c05768
commit
9f2f5f7292
|
|
@ -68,7 +68,10 @@ pub fn viewport_builder(
|
|||
#[cfg(not(target_os = "ios"))]
|
||||
if native_options.centered {
|
||||
crate::profile_scope!("center");
|
||||
if let Some(monitor) = event_loop.available_monitors().next() {
|
||||
if let Some(monitor) = event_loop
|
||||
.primary_monitor()
|
||||
.or_else(|| event_loop.available_monitors().next())
|
||||
{
|
||||
let monitor_size = monitor
|
||||
.size()
|
||||
.to_logical::<f32>(egui_zoom_factor as f64 * monitor.scale_factor());
|
||||
|
|
|
|||
Loading…
Reference in New Issue