1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-04 15:04:38 -04:00

Fixed keyboard input for negative values on realtive integer value dials (issue #168)

This commit is contained in:
f4exb
2018-05-08 10:10:15 +02:00
parent 0c946d86e2
commit 4bb63bbf1b
5 changed files with 18 additions and 7 deletions
+9 -4
View File
@@ -599,12 +599,17 @@ void ValueDialZ::keyPressEvent(QKeyEvent* value)
{
int d = c.toLatin1() - '0';
quint64 e = findExponent(m_cursor);
quint64 v = (m_value / e) % 10;
if(m_animationState != 0)
quint64 value = abs(m_value);
int sign = m_value < 0 ? -1 : 1;
quint64 v = (value / e) % 10;
if(m_animationState != 0) {
m_value = m_valueNew;
v = m_value - v * e;
}
v = value - v * e;
v += d * e;
setValue(v);
setValue(sign*v);
emit changed(m_valueNew);
m_cursor++;