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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
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)); |
|
|
|
} |
|
|
|
} |
|
|
|
|