Browse Source

pixel size api impl updated.

pull/2046/head
Dan Walmsley 8 years ago
parent
commit
43f6eb52ea
  1. 4
      src/Avalonia.Native/GlPlatformFeature.cs
  2. 4
      src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs
  3. 6
      src/Windows/Avalonia.Win32/WindowImpl.cs

4
src/Avalonia.Native/GlPlatformFeature.cs

@ -100,12 +100,12 @@ namespace Avalonia.Native
public IGlDisplay Display { get; } public IGlDisplay Display { get; }
public System.Drawing.Size PixelSize public PixelSize Size
{ {
get get
{ {
var s = _session.GetPixelSize(); var s = _session.GetPixelSize();
return new System.Drawing.Size(s.Width, s.Height); return new PixelSize(s.Width, s.Height);
} }
} }

4
src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs

@ -510,12 +510,12 @@ namespace Avalonia.Gtk3
: new ImmediateRenderer(root); : new ImmediateRenderer(root);
} }
System.Drawing.Size EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.PixelSize PixelSize EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Size
{ {
get get
{ {
var cs = ClientSize; var cs = ClientSize;
return new System.Drawing.Size((int)Math.Max(1, LastKnownScaleFactor * cs.Width), return new PixelSize((int)Math.Max(1, LastKnownScaleFactor * cs.Width),
(int)Math.Max(1, LastKnownScaleFactor * ClientSize.Height)); (int)Math.Max(1, LastKnownScaleFactor * ClientSize.Height));
} }
} }

6
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -933,14 +933,14 @@ namespace Avalonia.Win32
_topmost = value; _topmost = value;
} }
System.Drawing.Size EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.PixelSize PixelSize EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Size
{ {
get get
{ {
RECT rect; RECT rect;
GetClientRect(_hwnd, out rect); GetClientRect(_hwnd, out rect);
return new System.Drawing.Size( return new PixelSize(
Math.Max(1, rect.right - rect.left), Math.Max(1, rect.right - rect.left),
Math.Max(1, rect.bottom - rect.top)); Math.Max(1, rect.bottom - rect.top));
} }

Loading…
Cancel
Save