1
0
Эх сурвалжийг харах

Remove hack from VirtualizingStackPanel.

No longer needed since layout invalidation was fixed in last commit.
Steven Kirk 2 жил өмнө
parent
commit
b8fed4cbea

+ 0 - 34
src/Avalonia.Controls/VirtualizingStackPanel.cs

@@ -556,7 +556,6 @@ namespace Avalonia.Controls
                 GetItemIsOwnContainer(items, index) ??
                 GetRecycledElement(items, index) ??
                 CreateElement(items, index);
-            InvalidateHack(e);
             return e;
         }
 
@@ -705,39 +704,6 @@ namespace Avalonia.Controls
             }
         }
 
-        private static void InvalidateHack(Control c)
-        {
-            bool HasInvalidations(Control c)
-            {
-                if (!c.IsMeasureValid)
-                    return true;
-
-                for (var i = 0; i < c.VisualChildren.Count; ++i)
-                {
-                    if (c.VisualChildren[i] is Control child)
-                    {
-                        if (!child.IsMeasureValid || HasInvalidations(child))
-                            return true;
-                    }
-                }
-
-                return false;
-            }
-
-            void Invalidate(Control c)
-            {
-                c.InvalidateMeasure();
-                for (var i = 0; i < c.VisualChildren.Count; ++i)
-                {
-                    if (c.VisualChildren[i] is Control child)
-                        Invalidate(child);
-                }
-            }
-
-            if (HasInvalidations(c))
-                Invalidate(c);
-        }
-
         private void OnUnrealizedFocusedElementLostFocus(object? sender, RoutedEventArgs e)
         {
             if (_unrealizedFocusedElement is null || sender != _unrealizedFocusedElement)