Fixed issues with Padding

This commit is contained in:
Brian Ferguson 2013-07-21 09:49:16 -06:00
parent 5f1d1c5888
commit e3c8ae2dfa
2 changed files with 8 additions and 4 deletions

View File

@ -308,19 +308,23 @@ void Meter::ReadOptions(ConfigParser& parser, const WCHAR* section)
static const Gdiplus::Rect defPadding; static const Gdiplus::Rect defPadding;
m_Padding = parser.ReadRect(section, L"Padding", defPadding); m_Padding = parser.ReadRect(section, L"Padding", defPadding);
int oldW = m_W;
bool oldWDefined = m_WDefined; bool oldWDefined = m_WDefined;
int w = parser.ReadInt(section, L"W", m_W); int w = parser.ReadInt(section, L"W", m_W);
m_WDefined = parser.GetLastValueDefined(); m_WDefined = parser.GetLastValueDefined();
if (IsFixedSize(true)) m_W = w + GetWidthPadding(); if (IsFixedSize(true)) m_W = w;
if (oldW != m_W) m_W += GetWidthPadding();
if (!m_WDefined && oldWDefined && IsFixedSize()) if (!m_WDefined && oldWDefined && IsFixedSize())
{ {
m_W = 0; m_W = 0;
} }
int oldH = m_H;
bool oldHDefined = m_HDefined; bool oldHDefined = m_HDefined;
int h = parser.ReadInt(section, L"H", m_H); int h = parser.ReadInt(section, L"H", m_H);
m_HDefined = parser.GetLastValueDefined(); m_HDefined = parser.GetLastValueDefined();
if (IsFixedSize(true)) m_H = h + GetHeightPadding(); if (IsFixedSize(true)) m_H = h;
if (oldH != m_H) m_H += GetHeightPadding();
if (!m_HDefined && oldHDefined && IsFixedSize()) if (!m_HDefined && oldHDefined && IsFixedSize())
{ {
m_H = 0; m_H = 0;

View File

@ -398,8 +398,8 @@ bool MeterString::Update()
} }
else else
{ {
m_W = GetWidthPadding() + 1; m_W = 1;
m_H = GetHeightPadding() + 1; m_H = 1;
} }
} }