applying Normal barline won't remove pre-existing barline.
This is on 3.0-dev c231be2 but not on 2.1 or 2.0.3:
- have any barline other than NORMAL
- drop a NORMAL barline onto the measure before that barline (or ontop of that barline)
Observe that the barline remains as was before.
Comments
The problem is that when ScoreView::dropEvent() gets invoked, dragElement is set to a Barline of type UNKNOWN (0) when it should be of type NORMAL (1). I'm looking into this now...
in ScoreView::dragEnterEvent(), Element* el = Element::create(type, score()); is producing a BarLine element of type UNKNOWN when it should be NORMAL...Actually that is fine. But the problem is that dragElement->read(e); is not reading the barline type as NORMAL.
BarLine::read(XmlReader& e) for some reason has:
// resetProperty(P_ID::BARLINE_TYPE);
commented out. That is the source of the problem.
https://github.com/musescore/MuseScore/commit/22454df70e38f7e05ae0eb9ec…
that is Werner's commit "small fixes for save/restore barlines" which commented out that line, but I don't completely know what is being done there...other than seeming to have the default state of a barline to be UNKNOWN instead of NORMAL...
sure enough, uncommenting that line fixes it.
Now there is also the problem that dropping a NORMAL barline onto a START_REPEAT barline is not doing anything...most likely the drop logic is not taking into account the fact that the START_REPEAT barline is the first segment of the *next* measure.
That's because BarLine::drop() is not actually performing any flag updating, since both if blocks are ignored:
I believe that:
needs to be changed into:
well not quite.
Anyway, it seems I would want to remove the start repeat from the beginning of that measure. Questions becomes if the START_REPEAT drop target is actually part of an END_START_REPEAT which straddle a line break...then I would say to remove it. But of course if there are linked parts that aren't straddling a line break, then would want to take special care to convert them all into an END_REPEAT. I'll take a look at this some more tomorrow.
Not sure if it helps at all but see https://github.com/musescore/MuseScore/blob/master/mscore3.txt#L217
my last commit has some fixes
thanks, that commit seems to have fixed this issue.
I'm going to PR a small mtest for this so doesn't break in future.
one thing I noticed is that there is not symettric behavior between the following actions when an END_START_REPEAT straddles a newline:
1. dropping a NORMAL barline on the END_REPEAT element will remove both the END_REPEAT and START_REPEAT.
2. dropping a NORMAL barline on the START_REPEAT element will remove the START_REPEAT but will leave the END_REPEAT intact.
I don't want to call this behavior "wrong" but I think it would be better to have it symmetric, such that (1.) would only remove the END_REPEAT but leave the START_REPEAT intact.
Anyway, I will make test case, but I'm not going to QVERIFY that (1.) removes the START_REPEAT nor that (2.) would leave the END_REPEAT intact. I don't want to enforce that behavior just yet...
I'm marking this as fixed.
I made a PR for mtest solidifying the well-defined behavior: https://github.com/musescore/MuseScore/pull/3041
(again, I'm not solidifying what should be done to the other half of an END_START_REPEAT that straddles a newline...)
I changed the behaviour as you suggested. In addition if there is a end-start-repeat barline:
- if you drop a normal barline onto the end-start-repeat its replaced by a normal barline
- if you drop a normal barline onto the measure, the end-start-repeat is replaced by a start-repeat
Thanks. I made a PR https://github.com/musescore/MuseScore/pull/3043 which added the following verification to the mtest if an END_START_REPEAT straddles a newline:
1. dropping a NORMAL barline on the END_REPEAT will turn the END_REPEAT into NORMAL, but keep the START_REPEAT.
2. dropping a NORMAL barline on the START_REPEAT will remove the START_REPEAT, but keep the END_REPEAT.
note that:
behavior was already present in your prior commit and that the mtest already had covered that.
But I am not going to have the mtest verify the following behavior just yet:
The reason I don't like it is because the user sees *one* selectable element (the END_START_REPEAT) and would think that element would be replaced with the one that is being dragged from the palette: the NORMAL barline. But the behavior you set has that element being turned into a different element. Although I do like one positive aspect of your behavior, which is the that the behavior would be consistent across parts and main score regardless of the presence of line/page breaks. So I'm undecided.
Anyway, I found some separate issues.
Automatically closed -- issue fixed for 2 weeks with no activity.