Browse Source

Merge pull request #5413 from joaompneves/nativehostcontrol-emptybounds-fix

Fixed NativeControlHost to prevent calling ShowInBounds when bounds empty
Dan Walmsley 4 years ago
parent
commit
94300c7d8b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/Avalonia.Controls/NativeControlHost.cs

+ 5 - 1
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()