From 26b748d664fafa1821b82720325b11c72266a1f7 Mon Sep 17 00:00:00 2001 From: Yimeng Wu Date: Fri, 10 Nov 2023 22:56:44 +0000 Subject: [PATCH] Port microsoft/microsoft-ui-xaml#4412 (#604) --- .../Repeater/Layouts/FlowLayout/FlowLayoutAlgorithm.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ModernWpf.Controls/Repeater/Layouts/FlowLayout/FlowLayoutAlgorithm.cs b/ModernWpf.Controls/Repeater/Layouts/FlowLayout/FlowLayoutAlgorithm.cs index daac58f3..9c11f546 100644 --- a/ModernWpf.Controls/Repeater/Layouts/FlowLayout/FlowLayoutAlgorithm.cs +++ b/ModernWpf.Controls/Repeater/Layouts/FlowLayout/FlowLayoutAlgorithm.cs @@ -471,9 +471,9 @@ private bool ShouldContinueFillingUpSpace( // Ensure that both minor and major directions are taken into consideration so that if the scrolling direction // is the same as the flow direction we still stop at the end of the viewport rectangle. - shouldContinue = - (direction == GenerateDirection.Forward && elementMajorStart < rectMajorEnd && elementMinorStart < rectMinorEnd) || - (direction == GenerateDirection.Backward && elementMajorEnd > rectMajorStart && elementMinorEnd > rectMinorStart); + shouldContinue = direction == GenerateDirection.Forward + ? elementMajorStart < rectMajorEnd && elementMinorStart < rectMinorEnd + : elementMajorEnd > rectMajorStart && elementMinorEnd > rectMinorStart; } return shouldContinue;