From 817ef37b806ef5876e7305f49e85d2fceff22bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Tue, 2 Feb 2021 13:59:31 +0000 Subject: [PATCH] Fixed NativeControlHost to prevent calling ShowInBounds when control bounds are empty. --- src/Avalonia.Controls/NativeControlHost.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/NativeControlHost.cs b/src/Avalonia.Controls/NativeControlHost.cs index 20eac11c2c..64414b1f47 100644 --- a/src/Avalonia.Controls/NativeControlHost.cs +++ b/src/Avalonia.Controls/NativeControlHost.cs @@ -157,10 +157,14 @@ namespace Avalonia.Controls var needsShow = IsEffectivelyVisible && bounds.HasValue; if (needsShow) + { + if (bounds.Value.IsEmpty) + return false; _attachment?.ShowInBounds(bounds.Value); + } else _attachment?.HideWithSize(Bounds.Size); - return false; + return true; } private void CheckDestruction()