Browse Source

Invoke ScalingChanged when scaling changed on iOS (#18767)

pull/18759/head
Maxwell Katz 1 year ago
committed by GitHub
parent
commit
808c86f94a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      src/iOS/Avalonia.iOS/AvaloniaView.cs

5
src/iOS/Avalonia.iOS/AvaloniaView.cs

@ -375,6 +375,11 @@ namespace Avalonia.iOS
{
_topLevelImpl.Resized?.Invoke(_topLevelImpl.ClientSize, WindowResizeReason.Layout);
var scaling = (double)ContentScaleFactor;
if (_latestLayoutProps.scaling != scaling)
{
_topLevelImpl.ScalingChanged?.Invoke(scaling);
}
_latestLayoutProps = (new PixelSize((int)(Bounds.Width * scaling), (int)(Bounds.Height * scaling)), scaling);
if (_currentRenderTarget is not null)
{

Loading…
Cancel
Save