Fixed issue where the width/height of a meter would not update when using the Padding option.

This commit is contained in:
Brian Ferguson 2013-08-31 23:58:12 -06:00
parent df84ba961c
commit e62a1aa262

View File

@ -313,7 +313,8 @@ void Meter::ReadOptions(ConfigParser& parser, const WCHAR* section)
int w = parser.ReadInt(section, L"W", m_W);
m_WDefined = parser.GetLastValueDefined();
if (IsFixedSize(true)) m_W = w;
if (oldW != m_W) m_W += GetWidthPadding();
const int widthPadding = GetWidthPadding();
if (oldW != (m_W - widthPadding)) m_W += widthPadding;
if (!m_WDefined && oldWDefined && IsFixedSize())
{
m_W = 0;
@ -324,7 +325,8 @@ void Meter::ReadOptions(ConfigParser& parser, const WCHAR* section)
int h = parser.ReadInt(section, L"H", m_H);
m_HDefined = parser.GetLastValueDefined();
if (IsFixedSize(true)) m_H = h;
if (oldH != m_H) m_H += GetHeightPadding();
const int heightPadding = GetHeightPadding();
if (oldH != (m_H - heightPadding)) m_H += heightPadding;
if (!m_HDefined && oldHDefined && IsFixedSize())
{
m_H = 0;