Staff spacer down on first system of page affects spacing of previous page

• Aug 19, 2015 - 19:39
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Ubuntu 14.04, GIT commit: 699a5ee

1) load attached score
2) position view so you can see left side of page 1 & right side of page 2 at once
3) extend spacer on first measure of page 2
4) watch page 1

Result: as you extend the spacer on page 2, the spacing on page 1 decreases. However, if you change the line break at the end of page 1 to a page break, the problem goes away.

What I think must be happening is, without the page break, we are trying to see if there is room for another system on page 1 and hence looking at the system with the spacer, correctly determining that there is not room for it, but in the act of looking at that system, somehow that extra distance for the spacer is still allocated to this page. I have long had the nagging feeling there might be an issue like this lurking in the code but never quite caught it in action before today.

This bug did not exist in 1.3, FWIW, which used a pretty different method of spacing systems. But it *does* still exist in my PR https://github.com/musescore/MuseScore/pull/2147 (which implements "negative" - better term might be "absolute" - staff spacers). I will try to fix this independently of that PR, but if the code overlaps too much, I may wait until we come to a decision on that PR.

Attachment Size
spacer-after-page.mscz 6.26 KB

Comments

Problem is the code I added here:

https://github.com/musescore/MuseScore/blob/6084a74bba58da44ddeb3784440…

The intent is to figure out the amount of extra space the last system on the page needs, but it turns out "pC.sr" is only the last system of the page if this is the only page or if there is a page break. Otherwise, it is first system of the next page (the one we had to look at before deciding it would not fit).

Hopefully an easy fix, and it does indeed seem to be pretty independent of my "absolute staff spacer" code.

EDIT: cadiz1 nailed it! :-). BTW, there are other side effects of this issue, such as that lyrics on the last system of a page will extend into the margin (exactly what I was trying to prevent) unless there is an explicit page break.