mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- Fixed negative W/H issue: http://rainmeter.net/forum/viewtopic.php?t=8614&p=59732#p59732
- Code cleanup.
This commit is contained in:
@ -71,7 +71,10 @@ void CMeterLine::Initialize()
|
||||
{
|
||||
m_AllValues.push_back(std::vector<double>());
|
||||
|
||||
m_AllValues.back().assign(m_W, 0.0);
|
||||
if (m_W > 0)
|
||||
{
|
||||
m_AllValues.back().assign(m_W, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -80,13 +83,17 @@ void CMeterLine::Initialize()
|
||||
}
|
||||
}
|
||||
|
||||
if (num != (size_t)m_W)
|
||||
if (m_W < 0 || num != (size_t)m_W)
|
||||
{
|
||||
if (m_CurrentPos >= m_W) m_CurrentPos = 0;
|
||||
|
||||
num = (m_W < 0) ? 0 : m_W;
|
||||
for (size_t i = 0; i < allValuesSize; ++i)
|
||||
{
|
||||
m_AllValues[i].resize(m_W, 0.0);
|
||||
if (num != m_AllValues[i].size())
|
||||
{
|
||||
m_AllValues[i].resize(num, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -208,7 +215,7 @@ bool CMeterLine::Update()
|
||||
*/
|
||||
bool CMeterLine::Draw(Graphics& graphics)
|
||||
{
|
||||
if (!CMeter::Draw(graphics) || m_W == 0) return false;
|
||||
if (!CMeter::Draw(graphics) || m_W <= 0) return false;
|
||||
|
||||
double maxValue = 0.0;
|
||||
int counter = 0;
|
||||
|
Reference in New Issue
Block a user