D.S. & To Coda placed at beginning of measure instead of end

• Sep 6, 2013 - 19:28
Type
Functional
Severity
S4 - Minor
Status
closed
Project
Tags

GIT commit: a2b136c

Steps to reproduce:

1) drag "D.S." or "To Coda" from repeats palette to measure 2 of Promenade (or any score created from defaults)

Expected result: text is displayed at end of measure
Actual result: text is displayed at beginning

Also, if I have customized the text style (repeat text right) before placing the marking, this appears to be not honored. But if I double click the text to edit it, the font suddenly changes to reflect my customization.


Comments

Currently, these palette items are all set to Repeat Text as opposed to Repeat Text Left/Right. I can manually set the DS/DC and To Coda markings to Repeat Text Right, but while this does right align the text, it does so to the *beginning* rather than to the *end* of the measure. I am not sure how that is supposed to be implemented - I guess it was formerly done with RelX, maybe?

BTW, Repeat Text and Repeat Text Right are also set way too small. Repeat Text Left is good, though.

The current revision 0c9029e364 moves Jump & Marker elements from Segment back to Measure. Also the "layout to parent width" flag is set which means that left & right alignment is done based on measure width.

Thanks, this should allows us to get the repeat texts working as they should.

I see we have three text styles: REPEAT, REPEAT_LEFT, and REPEAT_RIGHT.

My understanding is that 1.3 scores will come in with all markers using REPEAT because that is all there was. Should we change the defaults for newly created markers to use REPEAT_LEFT? I was under the impression we wanted to obsolete REPEAT, keeping it only for compatibility. I think that makes sense.

The "sym" tags we now use for segno and coda use the "Musical text font" at the size specified by the current text style, correct? If so, then I think REPEAT_LEFT and REPEAT_RIGHT should both be set to 20pt.

The REPEAT text style is actually ignored as far as I can tell for 1.3 scores. Each marker has its size hard-coded in its HTML. So we *could* even convert them to REPEAT_LEFT on import if we wanted.

If I'm on the right track here, I could make these changes myself if you like.

Status (old) active patch (code needs review)

Here's a PR implementing what I suggested:

https://github.com/musescore/MuseScore/pull/1104

It could stand review. A couple of things to note:

- I overrode Marker::layout() so I could force left-aligned markers to center over the left barline (which is good default behavior, and was implemented in 1.3 as well).

- 1.3 used REPEAT text style for both markers and jumps, and somehow sorted out which to left align and which to right align (presumably using the label). I elected to have REPEAT be right aligned, then force the elements that should be left aligned (codas and segnos) to use REPEAT_LEFT

- We kind of got lucky that all the left aligned elements are symbols and all the right aligned ones are plain text. This made it possible to choose appropriate default sizes (20 for symbols, 12 for text). Users wanting to embed a coda sign with the "DS al Coda" text will have to up the size of the symbol to match the text.

Here is how the various symbols look by default now:

repeat-text.png

Attachment Size
repeat-text.png 16.84 KB