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.
This commit is contained in:
Madadog
2023-07-30 21:27:05 +10:00
committed by GitHub
parent a9d49d4ff7
commit 086e86490f

View File

@@ -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);