From 085ab81614cacd27a77ff1164e75fc4b8f2ba5a2 Mon Sep 17 00:00:00 2001 From: eolivesjoe Date: Tue, 19 May 2026 14:04:49 +1000 Subject: [PATCH] Fix ToolBarTray negative measure constraint --- .../System/Windows/Controls/ToolBarTray.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ToolBarTray.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ToolBarTray.cs index cbb784ce52c..137dff4864f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ToolBarTray.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ToolBarTray.cs @@ -360,7 +360,7 @@ protected override Size MeasureOverride(Size constraint) { ToolBar toolBar = band[toolBarIndex]; remainingLength -= toolBar.MinLength; - if (DoubleUtil.LessThan(remainingLength, 0)) + if (remainingLength < 0) { remainingLength = 0; break; @@ -380,7 +380,7 @@ protected override Size MeasureOverride(Size constraint) bandThickness = Math.Max(bandThickness, fHorizontal ? toolBar.DesiredSize.Height : toolBar.DesiredSize.Width); bandLength += fHorizontal ? toolBar.DesiredSize.Width : toolBar.DesiredSize.Height; remainingLength -= fHorizontal ? toolBar.DesiredSize.Width : toolBar.DesiredSize.Height; - if (DoubleUtil.LessThan(remainingLength, 0)) + if (remainingLength < 0) { remainingLength = 0; }