Browse Source

Make sure MacOS uses the cached value for render scaling. (#18062)

pull/17636/merge
Dan Walmsley 1 year ago
committed by GitHub
parent
commit
e175ff21e8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      src/Avalonia.Native/TopLevelImpl.cs

5
src/Avalonia.Native/TopLevelImpl.cs

@ -95,7 +95,7 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{ {
_handle = handle; _handle = handle;
_savedLogicalSize = ClientSize; _savedLogicalSize = ClientSize;
_savedScaling = RenderScaling; _savedScaling = Native?.Scaling ?? 1;;
_nativeControlHost = new NativeControlHostImpl(Native!.CreateNativeControlHost()); _nativeControlHost = new NativeControlHostImpl(Native!.CreateNativeControlHost());
_platformBehaviorInhibition = new PlatformBehaviorInhibition(Factory.CreatePlatformBehaviorInhibition()); _platformBehaviorInhibition = new PlatformBehaviorInhibition(Factory.CreatePlatformBehaviorInhibition());
_surfaces = new object[] { new GlPlatformSurface(Native), new MetalPlatformSurface(Native), this }; _surfaces = new object[] { new GlPlatformSurface(Native), new MetalPlatformSurface(Native), this };
@ -121,7 +121,8 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
} }
} }
public double RenderScaling => Native?.Scaling ?? 1;
public double RenderScaling => _savedScaling;
public IEnumerable<object> Surfaces => _surfaces ?? Array.Empty<object>(); public IEnumerable<object> Surfaces => _surfaces ?? Array.Empty<object>();
public Action<RawInputEventArgs>? Input { get; set; } public Action<RawInputEventArgs>? Input { get; set; }
public Action<Rect>? Paint { get; set; } public Action<Rect>? Paint { get; set; }

Loading…
Cancel
Save