diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 4c9543265..22cc09f3a 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2760,7 +2760,7 @@ void PianoRoll::updateKnifePos(QMouseEvent* me) { // Calculate the TimePos from the mouse int mouseViewportPos = me->x() - m_whiteKeyWidth; - int mouseTickPos = mouseViewportPos / (m_ppb / TimePos::ticksPerBar()) + m_currentPosition; + int mouseTickPos = mouseViewportPos * TimePos::ticksPerBar() / m_ppb + m_currentPosition; // If ctrl is not pressed, quantize the position if (!(me->modifiers() & Qt::ControlModifier))