Staff spacer down doesn't work at page bottom

• Jan 5, 2019 - 16:05
Reported version
P1 - High
S3 - Major

Adding a Staff spacer down, it doesn't work. Increasing height, the music remains in the same position respect to page border (A4, A5, portrait, landscape).
Musescore stable v3.0 on Linux

Attachment Size
Error.staff_.space_.down_.png 27.87 KB


Status active needs info

Works fine for me (Linux too). Could it be, you've added the staff spacer to the wrong staff (to the second instead of the first)? Please attache the score, you've trouble with, explain steps to reproduce and describe what is the expected and the actual behavior.

Priority P2 - Medium P1 - High
Status closed active
Reported version 3.0 3.x-dev

Either my fix was incomplete or it broke again later, but anyhow - it seems it fails for systems of more than one staff. Take the default score, add a score staff, then add a spacer to the bottom system of the first page. It has no effect.

See also, which turns out to provide the key to the solution. It turns out then when we go to calculate the space requires due to spacers for a system, we don't end up looking at the last visible staff, but instead, the top. That's because in System::spacerDistance, we call lastVisibleSysStaff() but then access its "idx" expecting that to be meaningful, and it's not - it's always 0. Need further investigation to understand what that field is even doing there, then, or why this doesn't cause much worse problems in lots of other places, but anyhow, I see why this doesn't work.

Status PR created fixed

Fixed in branch master, commit 1d56d5564b

_fix #281253: staff spacer down ignored on bottom of page


A staff spacer on the bottom system of a page does not work correctly:
we are looking foir a spacer on the first staff rather than the last.
So a spacer on the last staff is ignored, and one on the first is used
when it shouldn't be.

The code to calculate the amount of spacer required below the last
system of a page relies on System::lastVisibleSysStaff(),
which is return the correct SysStaff, but we are then attempting
to access the idx member, which has never been set up and is always 0.
Fix is to initialize idx when setting up the list of staves._

Fix version