Browse Source

Merge pull request #2303 from AvaloniaUI/fixes/x11-monitor-scaling-fullhd-and-below

Scaling of 1 on monitors >= FullHD
pull/2313/head
danwalmsley 7 years ago
committed by GitHub
parent
commit
dbbb5bd944
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Avalonia.X11/X11Screens.cs

3
src/Avalonia.X11/X11Screens.cs

@ -218,6 +218,7 @@ namespace Avalonia.X11
class X11Screen
{
private const int FullHDWidth = 1920;
public bool Primary { get; }
public string Name { get; set; }
public PixelRect Bounds { get; set; }
@ -247,6 +248,6 @@ namespace Avalonia.X11
}
public static double GuessPixelDensity(double pixelWidth, double mmWidth)
=> Math.Max(1, Math.Round(pixelWidth / mmWidth * 25.4 / 96));
=> pixelWidth <= FullHDWidth ? 1 : Math.Max(1, Math.Round(pixelWidth / mmWidth * 25.4 / 96));
}
}

Loading…
Cancel
Save