There is a gap between the end of a staff (system) and the last barline (before a break), in case of a clef change to the next bar in a hidden instrument and show courtesy clef is on.

• Oct 15, 2020 - 21:32
Reported version
3.5
Type
Functional
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
Yes
Project

Steps to reproduce the issue:
1) Set up a score with at least two instruments/staffs.
2) In one instrument/staff, add a clef change at the beginning of the second system.
3) Make sure that Show courtesy clef is On.
4) Hide that instrument.
See the gap at the end of the first system and the last barline.
There is a gap between the end of a staff (system) and the last barline (before a break), in case of a clef change to the next bar in a hidden instrument and show courtesy clef is on.mscz

Steps for a workaround:
1) Unhide all instruments/staffs.
2) At the specific system end, for every clef change: Uncheck Show courtesy clef.
3) Rehide the instruments/staffs.

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.5.1.293615790, revision: 12ab1d9, Dutch language.


Comments

Severity S4 - Minor S3 - Major

I can confirm this error occurs in 3.5 and later (including current 3.6.1) but not in earlier releases. Curiously, it only affects invisible staves, not ones that are hidden because they are empty. Often it's the other way around, the hide empty staves logic is much more complex. Investigating.

Status PR created fixed

Fixed in branch 3.x, commit b79e923be1

_fix #311788: gap between staff and end barline with courtesy clef

Resolves: https://musescore.org/en/node/311788

A recent commit fixed some issues with courtesy clefs,
but introduced a regression - courtesy clefs on invisible staves
were not being ignored, causing the segment to be marked visible
and rhen in turn the measure width to be recalculated
as if the clef were visible.
This puts the barline too far to the right,
with gap between the end of the staff and the barline.
The clef itself was still ignored in the width calculation,
so the discrepancy is not large -
only the size of the margins before and after the clef.

Fix is to skip invisible staves in the code that is checking
for measures that need their width recalculated.

AIn debugging this, I became aware this clef on an invisible staff
was also appearing to affect the skyline of the visible staff,
leading me on a wild goose chase,
But that turns out to be an illusion -
the clef is not added to the skyline of the visible staff at all.
It's just that the skyline drawing code
(used when turning "Show Skylines" in the Debug menu)
is also failing to skip invisible staves.
So I have fixed that as well._

Fix version
3.6.2