Fixed minor calculation error in Tab which caused the width to be off by a few pixels sometimes

0.8
Bruno Van de Velde 2015-03-28 23:45:32 +01:00
parent 8b2895a327
commit 709da22d43
1 changed files with 4 additions and 1 deletions

View File

@ -205,7 +205,10 @@ namespace tgui
m_tabTexts.insert(m_tabTexts.begin() + index, std::move(newTab));
// Update the cached width of the widget
m_width += *tabWidthIt + ((getRenderer()->getBorders().left + getRenderer()->getBorders().right) / 2.0f);
if (m_tabTexts.size() > 1)
m_width += *tabWidthIt + ((getRenderer()->getBorders().left + getRenderer()->getBorders().right) / 2.0f);
else
m_width += *tabWidthIt;
if (m_selectedTab >= static_cast<int>(index))
m_selectedTab++;