From 9dea124ec29d42445081a3f7a4a790e3852b8d86 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 17 Apr 2019 12:44:55 +0300 Subject: [PATCH] (12dd79a54) Fixed GUIListBoxes still sometimes leaving the last row out when using a grid layout --- Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs index 049ea780e..528ce8e2b 100644 --- a/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs +++ b/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs @@ -511,10 +511,8 @@ namespace Barotrauma pos = 0; totalSize += child.Rect.Width + spacing; } - else - { - pos += child.Rect.Height + spacing; - } + pos += child.Rect.Height + spacing; + if (child == children.Last()) { totalSize += child.Rect.Width + spacing; @@ -527,10 +525,7 @@ namespace Barotrauma pos = 0; totalSize += child.Rect.Height + spacing; } - else - { - pos += child.Rect.Width + spacing; - } + pos += child.Rect.Width + spacing; if (child == children.Last()) {