From 4b403feced63d5039c98fcc853fe717d04b6ba97 Mon Sep 17 00:00:00 2001 From: Nick Mazuk Date: Thu, 16 Sep 2021 09:17:08 +0200 Subject: [PATCH] Fix bug in musescore#9086, inner hidden staves affect bracket span Backport of #9140, follow up for #9086 --- libmscore/bracket.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libmscore/bracket.cpp b/libmscore/bracket.cpp index a045381ffcf0a..7b7f6d214055b 100644 --- a/libmscore/bracket.cpp +++ b/libmscore/bracket.cpp @@ -116,6 +116,13 @@ void Bracket::setStaffSpan(int a, int b) score()->styleSt(Sid::MusicalSymbolFont) != "Emmentaler" && score()->styleSt(Sid::MusicalSymbolFont) != "Gonville") { int v = _lastStaff - _firstStaff + 1; + + // if staves inner staves are hidden, decrease span + for (int staffIndex = _firstStaff; staffIndex <= _lastStaff; ++staffIndex) { + if (system() && !system()->staff(staffIndex)->show()) + --v; + } + if (score()->styleSt(Sid::MusicalSymbolFont) == "Leland") v = qMin(4, v); // total default height of a system of n staves / height of a 5 line staff