Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PatternEditor: take note lead-lag into account #2013

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/gui/src/PatternEditor/DrumPatternEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,9 @@ void DrumPatternEditor::drawNote( Note *note, QPainter& p, bool bIsForeground )
return;
}

QPoint pos ( PatternEditor::nMargin + note->get_position() * m_fGridWidth,
QPoint pos ( PatternEditor::nMargin +
( note->get_lead_lag() * AudioEngine::getLeadLagInTicks() +
note->get_position() ) * m_fGridWidth,
( nInstrument * m_nGridHeight) + (m_nGridHeight / 2) - 3 );

drawNoteSymbol( p, pos, note, bIsForeground );
Expand Down
4 changes: 3 additions & 1 deletion src/gui/src/PatternEditor/PianoRollEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ void PianoRollEditor::drawNote( Note *pNote, QPainter *pPainter, bool bIsForegro
Hydrogen *pHydrogen = Hydrogen::get_instance();
if ( pNote != nullptr && pNote->get_instrument() != nullptr &&
pNote->get_instrument() == pHydrogen->getSelectedInstrument() ) {
QPoint pos ( PatternEditor::nMargin + pNote->get_position() * m_fGridWidth,
QPoint pos ( PatternEditor::nMargin +
( pNote->get_lead_lag() * AudioEngine::getLeadLagInTicks() +
pNote->get_position() ) * m_fGridWidth,
m_nGridHeight * pitchToLine( pNote->get_notekey_pitch() ) + 1);
drawNoteSymbol( *pPainter, pos, pNote, bIsForeground );
}
Expand Down