From 1bb9d25ce38688851ac3dbc3438588b5129f1b5e Mon Sep 17 00:00:00 2001 From: Calum Matheson Date: Wed, 26 Feb 2025 14:19:13 +0000 Subject: [PATCH] Fix ShadowNotes not responding to instrument changes --- src/notation/internal/notationinteraction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/notation/internal/notationinteraction.cpp b/src/notation/internal/notationinteraction.cpp index 867a483e9850f..557d5b2fc3c38 100644 --- a/src/notation/internal/notationinteraction.cpp +++ b/src/notation/internal/notationinteraction.cpp @@ -417,7 +417,6 @@ bool NotationInteraction::showShadowNote(ShadowNote& shadowNote, ShadowNoteParam const mu::engraving::InputState& inputState = score()->inputState(); const Staff* staff = score()->staff(position.staffIdx); - const mu::engraving::Instrument* instr = staff->part()->instrument(); mu::engraving::Segment* segment = position.segment; qreal segmentSkylineTopY = 0; @@ -433,6 +432,8 @@ bool NotationInteraction::showShadowNote(ShadowNote& shadowNote, ShadowNoteParam Fraction tick = segment->tick(); qreal mag = staff->staffMag(tick); + const mu::engraving::Instrument* instr = staff->part()->instrument(tick); + // in any empty measure, pos will be right next to barline // so pad this by barNoteDistance qreal relX = position.pos.x() - position.segment->measure()->canvasPos().x();