Fix changing LcdSpinBox value changing their init value (#6241)

This commit is contained in:
merrickclay
2021-12-24 21:07:45 -07:00
committed by GitHub
parent 7e2ccc13d6
commit f8258253d5

View File

@@ -120,7 +120,7 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event )
model()->value() + m_remainder - fdy / 2.f * model()->step<int>();
float floatValRounded = roundf( floatValNotRounded );
m_remainder = floatValNotRounded - floatValRounded;
model()->setInitValue( floatValRounded );
model()->setValue( floatValRounded );
emit manualChange();
m_lastMousePos = event->globalPos();
}
@@ -145,7 +145,7 @@ void LcdSpinBox::mouseReleaseEvent(QMouseEvent*)
void LcdSpinBox::wheelEvent(QWheelEvent * we)
{
we->accept();
model()->setInitValue(model()->value() + ((we->angleDelta().y() > 0) ? 1 : -1) * model()->step<int>());
model()->setValue(model()->value() + ((we->angleDelta().y() > 0) ? 1 : -1) * model()->step<int>());
emit manualChange();
}