Skip to content

Commit e94d54d

Browse files
maxkatz6MrJul
authored andcommitted
Invoke ScalingChanged when scaling changed on iOS (#18767)
1 parent 340c98d commit e94d54d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/iOS/Avalonia.iOS/AvaloniaView.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ public override void LayoutSubviews()
375375
{
376376
_topLevelImpl.Resized?.Invoke(_topLevelImpl.ClientSize, WindowResizeReason.Layout);
377377
var scaling = (double)ContentScaleFactor;
378+
if (_latestLayoutProps.scaling != scaling)
379+
{
380+
_topLevelImpl.ScalingChanged?.Invoke(scaling);
381+
}
382+
378383
_latestLayoutProps = (new PixelSize((int)(Bounds.Width * scaling), (int)(Bounds.Height * scaling)), scaling);
379384
if (_currentRenderTarget is not null)
380385
{

0 commit comments

Comments
 (0)