diff --git a/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp b/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp index 8236b6f5..b009bc28 100644 --- a/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp +++ b/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp @@ -42,7 +42,9 @@ Size HorizontalNoOverflowStackPanel::ArrangeOverride(Size finalSize) auto lastChild = Children->GetAt(Children->Size - 1); float lastChildWidth = 0; if (Children->Size > 2 && ShouldPrioritizeLastItem()) + { lastChildWidth = lastChild->DesiredSize.Width; + } for (auto item : Children) { auto widthAvailable = finalSize.Width - posX; diff --git a/src/Calculator/Views/SupplementaryResults.xaml.cpp b/src/Calculator/Views/SupplementaryResults.xaml.cpp index 01f811af..06c83600 100644 --- a/src/Calculator/Views/SupplementaryResults.xaml.cpp +++ b/src/Calculator/Views/SupplementaryResults.xaml.cpp @@ -72,12 +72,14 @@ SupplementaryResults::SupplementaryResults() bool SupplementaryResultNoOverflowStackPanel::ShouldPrioritizeLastItem() { if (Children->Size == 0) + { return false; + } auto lastChild = dynamic_cast(Children->GetAt(Children->Size - 1)); if (lastChild == nullptr) + { return false; + } auto suppResult = dynamic_cast(lastChild->DataContext); - if (suppResult == nullptr) - return false; - return suppResult->IsWhimsical(); + return suppResult == nullptr? false: suppResult->IsWhimsical(); }