Incorrect drop anchor displayed while dragging a Volta
See brief forum post: https://musescore.org/en/node/291265
The problem arises because earlier versions of musescore, specifically 2.0.0, would have voltas be dropped to the nearest measure start, e.g.:
Sometime between 2.0.0 and 3.0, the displayed anchor line got changed to point to the start of the current measure the mouse is in, however the resulting drop was still operating on the old behavior to drop to the nearest start measure. Hence if your mouse was in the right half of the measure when releasing mouse, the volta would get dropped to the next measure even though the anchor line gave the expectation that the volta would be dropped to measure the mouse was in.
There was some debate on https://github.com/musescore/MuseScore/pull/5167 about how exactly the best way to deal with this is. The best guess now is that lines 313-4 in Score::cmdAddSpanner():
if (pos.x() >= (b.x() + b.width() * .5) && m != lastMeasureMM())
m = m->nextMeasure();
should simply be deleted as they are no longer wanted. They are in the else block:
{ // Anchor::MEASURE, Anchor::CHORD, Anchor::NOTE
and it doesn't seem like any other possible spanners with those anchors would want to drop to the next measure.
I'm marking as a regression since volta dropping made sense in 2.0.0, but just no longer make sense. And marked as workaround because can always drop in first half of a measure correctly.
Comments
I am finishing up a solution to this issue that involves returning to the behavior of 2.0.0 while retaining the ability to drop voltas on a per-staff basis if desired. I had to rename the title of this issue because it incorrectly stated the problem and contradicted the solution.
See https://github.com/musescore/MuseScore/pull/5182.
The fundamental problematic behavior is that the anchor line and the actual drop do not always correspond to each other. Two ways to correct MuseScore's problematic behavior are:
-OR-
My description corresponds with (1) and that is how I would propose to fix it. That shouldn't be characterized as "incorrectly stated the problem" or as "contradicted the solution". It is just a different approach that what you suggest. I actually think (1) is better because the volta gets applied to the measure where the mouse is currently in. But I wouldn't say that (2) is necessarily incorrect, either.
sorry, crossed message
I meant no disrespect. In saying "the anchor line and the actual drop do not always correspond to each other", you have correctly stated the problem. Solution 2 solves the problem, but not the way it was originally stated.
There was also a problem with the anchor point itself. It should only ever be at the beginning of a measure. My PR fixes that as well.
In reply to I meant no disrespect. In… by mattmcclinch
Ok thanks! :)
I've tried your PR and it works according to approach (2).
For a while I was torn between (1) and (2). The difference between the two is a matter of keeping or removing those two lines in Score::cmdAddSlur() and the corresponding lines in ScoreView::dragMeasureAnchorElement(). I eventually decided to go with (2), but I could have gone either way. I even considered the notion of changing the point at which the anchor moves to the next measure, but I ended up leaving it alone.
Fixed in branch master, commit 20eb2f1e0e
fix #291261: Make volta mouse drops apply only to first staff by default
fix #291431: Incorrect drop anchor displayed while dragging a Volta
Automatically closed -- issue fixed for 2 weeks with no activity.