Brace's width get unreasonably wide, when setting the 'Max. grand staff distance' value

• Nov 4, 2021 - 13:24
Reported version
3.6
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
PR created
Regression
No
Workaround
Yes
Project

Steps to reproduce:
1. go to style -> page
2. set 'Max. grand staff distance' value to a higher value (see the attached image)

Result => Brace's width get unreasonably wide (only braces, brackets are uneffected)
Expected Result => Brace's width should remains reasonable with it's height

Please see attached images for detail.

Version: 3.6.2.548021803

It seems that Musescore sets the brace's width based on what it thinks how tall the brace might possibly be (from the 'Max. grand staff distance' value) rather that it's actual height. Causing the braces to look squished if you set 'Max. grand staff distance' wrong.

There's workaround which is to set 'Max. grand staff distance' value as closest to what you think would be the height of the grand staff in the end after justification. But having to do this manually would defeat the purpose of having this feature in the first place, which should automatically calculate staves height in a page.

All this seems to only affect the braces and not brackets.

Thank you.

Attachment Size
brace width bug report.mscz 9.76 KB
brace width bug report.png 146.33 KB

Comments

Frequency Many Once
Severity S3 - Major S4 - Minor

Well, 50.5sp for the Max. grand staff distance (default being 6.5sp) is not a really reasonable value. Hence I don't see how this is a Major issue.
I agree though that the brace width should really get determined by the actual grand staff distance, not by its max.

Culprit code seems to be in libmscore/bracket.cpp. line 122-123 (shown here: 115-123):

      if (bracketType() == BracketType::BRACE &&
         score()->styleSt(Sid::MusicalSymbolFont) != "Emmentaler" && score()->styleSt(Sid::MusicalSymbolFont) != "Gonville")
            {
            int v = _lastStaff - _firstStaff + 1;
            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
            qreal dist = score()->enableVerticalSpread() ? score()->styleS(Sid::maxAkkoladeDistance).val() : score()->styleS(Sid::akkoladeDistance).val();
            _magx = v + ((v - 1) * dist / 4.0);

That _magx then gets used in libmscore/bracket.cpp. line 87 (shown here 79-88):

qreal Bracket::width() const
      {
      qreal w;
      switch (bracketType()) {
            case BracketType::BRACE:
                  if (score()->styleSt(Sid::MusicalSymbolFont) == "Emmentaler" || score()->styleSt(Sid::MusicalSymbolFont) == "Gonville")
                        w = score()->styleP(Sid::akkoladeWidth) + score()->styleP(Sid::akkoladeBarDistance);
                  else
                        w = (symWidth(_braceSymbol) * _magx) + score()->styleP(Sid::akkoladeBarDistance);
                  break;