Commit 12d3ff2a authored by Mall, Anon's avatar Mall, Anon
Browse files

maxheight minheight now taken in account when changing height

parent f28f9d40
......@@ -156,8 +156,10 @@ LinakDesk::setHeight(int height)
cout << __func__ << ": " << height << endl;
unique_lock<mutex> lck(m_cmdMutex);
height -= m_offset;
m_targetHeight = height > MAX_HEIGHT? MAX_HEIGHT : height;
m_targetHeight = m_targetHeight < MIN_HEIGHT? MIN_HEIGHT : m_targetHeight;
int maxHeight = m_maxHeight - m_offset;
int minHeight = m_minHeight - m_offset;
m_targetHeight = height > maxHeight? maxHeight : height;
m_targetHeight = m_targetHeight < minHeight? minHeight : m_targetHeight;
lck.unlock();
cout << __func__ << " set height: " << m_targetHeight << endl;
m_queue.addMessage(m_targetHeight);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment