From 6dc992d04c7a898dfbc503f5ee2cccbceeecb666 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 2 Jun 2020 13:36:20 +0200 Subject: [PATCH] Reset count to 0 when re-queueing control. When a layout of a control exceeds the maximum passes and we re-queue it, reset the attempt count to 0 because otherwise it can end up stuck in the layout queue forever even when the next layout can succeed with e.g. 2 passes. This can happen with `ItemsRepeater`. --- src/Avalonia.Layout/LayoutQueue.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Layout/LayoutQueue.cs b/src/Avalonia.Layout/LayoutQueue.cs index 96f893e7b0..e261a1b48e 100644 --- a/src/Avalonia.Layout/LayoutQueue.cs +++ b/src/Avalonia.Layout/LayoutQueue.cs @@ -77,7 +77,7 @@ namespace Avalonia.Layout { if (_shouldEnqueue(item.Key)) { - _loopQueueInfo[item.Key] = new Info() { Active = true, Count = item.Value.Count + 1 }; + _loopQueueInfo[item.Key] = new Info() { Active = true, Count = 0 }; _inner.Enqueue(item.Key); } }