From f16ec9c05415130046fc383c1bd55ffa9cb5c724 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 5 Oct 2021 03:41:36 +0200 Subject: [PATCH] Fix crash when zooming out during knife mode (#6184) --- src/gui/editors/PianoRoll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))