From 370574d2e22368752daa935964e92731a61768fb Mon Sep 17 00:00:00 2001 From: Michele Spagnolo Date: Mon, 12 Aug 2024 14:12:26 +0200 Subject: [PATCH] The selection state should be updated in all scores when something changes --- src/engraving/dom/cmd.cpp | 47 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/engraving/dom/cmd.cpp b/src/engraving/dom/cmd.cpp index c5373187a9373..a3e0f8048adef 100644 --- a/src/engraving/dom/cmd.cpp +++ b/src/engraving/dom/cmd.cpp @@ -497,34 +497,35 @@ void Score::update(bool resetCmdState, bool layoutAllParts) m_needSetUpTempoMap = false; } - { - MasterScore* ms = masterScore(); - CmdState& cs = ms->cmdState(); - if (updateAll || cs.updateAll()) { - for (Score* s : scoreList()) { - for (MuseScoreView* v : s->m_viewer) { - v->updateAll(); - } - } - } else if (cs.updateRange()) { - // updateRange updates only current score - double d = style().spatium() * .5; - m_updateState.refresh.adjust(-d, -d, 2 * d, 2 * d); - for (MuseScoreView* v : m_viewer) { - v->dataChanged(m_updateState.refresh); + MasterScore* ms = masterScore(); + CmdState& cs = ms->cmdState(); + if (updateAll || cs.updateAll()) { + for (Score* s : scoreList()) { + for (MuseScoreView* v : s->m_viewer) { + v->updateAll(); } - m_updateState.refresh = RectF(); } - if (playlistDirty()) { - masterScore()->setPlaylistClean(); - } - if (resetCmdState) { - cs.reset(); + } else if (cs.updateRange()) { + // updateRange updates only current score + double d = style().spatium() * .5; + m_updateState.refresh.adjust(-d, -d, 2 * d, 2 * d); + for (MuseScoreView* v : m_viewer) { + v->dataChanged(m_updateState.refresh); } + m_updateState.refresh = RectF(); + } + if (playlistDirty()) { + masterScore()->setPlaylistClean(); + } + if (resetCmdState) { + cs.reset(); } - if (m_selection.isRange() && !m_selection.isLocked()) { - m_selection.updateSelectedElements(); + for (Score* score : ms->scoreList()) { + Selection& sel = score->selection(); + if (sel.isRange() && !sel.isLocked()) { + sel.updateSelectedElements(); + } } }