not updating dead notes for transposition#32856
not updating dead notes for transposition#32856alexpavlov96 wants to merge 1 commit intomusescore:masterfrom
Conversation
📝 WalkthroughWalkthroughAdds early-exit guards and skip conditions for notes where Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
3f60481 to
9a292d9
Compare
9a292d9 to
076e9ce
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5930033e-0485-4d65-b36a-dbcd9191b191
📒 Files selected for processing (3)
src/engraving/dom/note.cppsrc/engraving/dom/stringdata.cppsrc/engraving/editing/transpose.cpp
| if (m_accidental) { | ||
| score()->undoRemoveElement(m_accidental); | ||
| } |
There was a problem hiding this comment.
Don't delete persisted accidental state in updateAccidental().
Line 2144 removes the Accidental element from the model, not just from layout. The ElementType::ACCIDENTAL branch in Note::remove() clears m_centOffset, and playingTuning() derives tuning from that field, so a dead-note refresh can silently discard microtonal tuning plus any user/courtesy accidental metadata. If dead notes should suppress accidentals visually, this needs to happen without removing the stored accidental state.
| as->setForceRestateAccidental(absLine, false); | ||
| updateRelLine(absLine, true); | ||
| return; |
There was a problem hiding this comment.
Don't consume forceRestateAccidental on a skipped note.
Line 2147 clears a one-shot flag in the shared AccidentalState even though this branch is explicitly skipping the note. If an earlier note or ornament set forceRestateAccidental for this pitch line, a dead note in between will swallow that request and the next live note will miss its courtesy/restated accidental.
Suggested fix
- as->setForceRestateAccidental(absLine, false);
updateRelLine(absLine, true);
return;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| as->setForceRestateAccidental(absLine, false); | |
| updateRelLine(absLine, true); | |
| return; | |
| updateRelLine(absLine, true); | |
| return; |
| if (note->deadNote()) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
The dead-note guard happens after the first write.
Line 248 already clears fretConflict before this continue, and Lines 305-311 can set it again afterwards. So dead notes are still being rewritten in fretChords(). If they are meant to stay untouched, the guard needs to move before the first mutation and be mirrored in the final conflict pass as well.
Summary by CodeRabbit