From 086e86490f26ace682e01e4109043faaccbf08bf Mon Sep 17 00:00:00 2001 From: Madadog <53168336+Madadog@users.noreply.github.com> Date: Sun, 30 Jul 2023 21:27:05 +1000 Subject: [PATCH] Fix scale highlighting during vertical zooming (#6761) Vertically zooming the piano roll caused highlighted semitones to drift from the actual note positions. This 2-line fix ensures the marked semitones are aligned with the grid lines and notes at all allowed vertical zoom levels. --- src/gui/editors/PianoRoll.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index adc1997b9..3ec008ecb 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -3355,11 +3355,11 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) for(x = 0; x < m_markedSemiTones.size(); ++x) { const int key_num = m_markedSemiTones.at(x); - const int y = keyAreaBottom() + 5 - m_keyLineHeight * + const int y = keyAreaBottom() - 1 - m_keyLineHeight * (key_num - m_startKey + 1); if(y > keyAreaBottom()) { break; } p.fillRect(m_whiteKeyWidth + 1, - y - m_keyLineHeight / 2, + y, width() - 10, m_keyLineHeight + 1, m_markedSemitoneColor);