Skip to content

Commit

Permalink
Make sure MacOS uses the cached value for render scaling. (#18062)
Browse files Browse the repository at this point in the history
  • Loading branch information
danwalmsley authored Jan 27, 2025
1 parent 01a7c85 commit e175ff2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Avalonia.Native/TopLevelImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal virtual void Init(MacOSTopLevelHandle handle)
{
_handle = handle;
_savedLogicalSize = ClientSize;
_savedScaling = RenderScaling;
_savedScaling = Native?.Scaling ?? 1;;
_nativeControlHost = new NativeControlHostImpl(Native!.CreateNativeControlHost());
_platformBehaviorInhibition = new PlatformBehaviorInhibition(Factory.CreatePlatformBehaviorInhibition());
_surfaces = new object[] { new GlPlatformSurface(Native), new MetalPlatformSurface(Native), this };
Expand All @@ -121,7 +121,8 @@ public Size ClientSize

}
}
public double RenderScaling => Native?.Scaling ?? 1;

public double RenderScaling => _savedScaling;
public IEnumerable<object> Surfaces => _surfaces ?? Array.Empty<object>();
public Action<RawInputEventArgs>? Input { get; set; }
public Action<Rect>? Paint { get; set; }
Expand Down

0 comments on commit e175ff2

Please sign in to comment.