Rehearsal Marker negative horizontal offset = bad layout

• May 21, 2016 - 20:44
Reported version
3.0
Type
Functional
Severity
S3 - Major
Status
closed
Project

This is tested with the latest master code and has existed for at least 2 weeks.
The attached minimal score illustrates the effect, a whole lot of empty horizontal space at the beginning of the measure.
Steps to reproduce:
1) new score
2) insert a note at the start of the first measure
3) attach a rehearsal marker to that note
4) in the Inspector, set the horizontal offset for that rehearsal marker to -10
The extra space is created.

Attachment Size
tempo_marker_layout.mscz 4.92 KB

Comments

Yes. That score has a negative offset on the Rehearsal Marker too. And yes, this issue's extra space gets worse each time the score redraws.

This issue is more precisely specified (it's the negative value in the horizontal offset), and the sample score is created from scratch.

The attached file has the horizontal offset of the rehearsal marker at 1.8sp.
If you set it to 1.7sp, you'll see the notes move.
If you set it to 1.9sp, you'll see the marker move.

So 1.8sp the tipping point, not 0.0sp. Also note that this only happens if the marker is attached to the first ChordRest of the measure. This lines up with the problem being in RehearsalMark::layout() here:
https://github.com/musescore/MuseScore/blob/master/libmscore/rehearsalm…

But I've commented out everything in RehearsalMark::layout() except these two lines:{syntaxhighlighter SPEC}
Text::layout1();
adjustReadPos();
{/syntaxhighlighter}
And the problem persists.

So I'm thinking the problem must be in the subsequent calls to MeasureBase::layout(), here:
https://github.com/musescore/MuseScore/blob/master/libmscore/measurebas…
This procedure gets called as part of the event chain, but I'm not seeing that it's part of this. I've looked in Score::layoutChords1(), Chord::layout(), Rest::layout() (this bug occurs even if the measure is empty, i.e. marker is attached to a whole note rest).

Why is a rehearsal mark causing any change in the measure layout? It's as if the rehearsal marker is being treated like a key signature, which does move the notes to the right. But it's also multiplying the error every time it redraws the score, making the extra blank space larger each time.

Attachment Size
tempo_marker_layout.mscz 4.78 KB

Yes, it is fixed.
I will note, however, that the first time you change the horizontal offset from zero to anything, the measure redraws and resizes. After that it works as expected, no changes to the measure width when you change the horizontal offset.