Note entry starts in first measure if range including last measure selected
Ubuntu 14.04, GIT commit: 3c10fc2
1) empty score
2) enter notes into last measure
3) exit note entry mdoe
4) select last measure
5) press "N"
Result: note entry begins in first measure. It works for some reason if the measure is empty.
I made a change recently to how the initial measure for note entry is computed, that I suspect may have broken this, or at least failed to fix it.
Comments
Was broken already in Beta 1. Issue is that activeCR() is not set if a range selection extends to the end of score. I'm not about to mess with the setting of activeCR(), but I can easily detect this case in startNoteEntry() get the first chord rest of the range instead.
Didn't we have other related issue? Related by the 'selection includes last measure'?
Could be - can you find it?
There probably is something not good about the fact that clicking the last measure of a piece doens't set activeCR(). I think there are a series of related things going on. When clicking any other measure, the selection rectangle does not extend all the way to barline. I think this is deliberate, although it's also basically the cause of #42881: Selection rectangle does not encompass empty measure if any staff has notes. When selecting the (non-empty) last measure by clicking an empty spot, the rectangle extends past the barline, indicating that this is somehow a different kind of selection, and this is when activeCR is not set. Probably something to do with the fact that end of a selection is recorded as the first segment *after* the selection, and this is null here. All sort of annoying special cases throughout the code for this that have been the source of numerous bugs, but way too late to revisit that choice.
If you select the last measure by clicking the first note and then using Shift+End (or Shift+Right repeatedly), you get a "normal" selection that doens't extend past the end barline, and activeCR() gets set, and note entry works as expected. Same for drag-select. So I guess maybe there is some special case code that should be added to the "click empty spot in measure". I'll look at that too, but again, I'd rather not mess with selection at this point.
It wasn't broken already in Beta 1. It was broken much sooner (and it has always been ?) I see exactly the same behaviour throughout the last months until May 19 (included: it works if the last measure is empty)
EDIT: And for this issue #42881: Selection rectangle does not encompass empty measure if any staff has notes, ditto, I see the same result on May 19.
https://github.com/musescore/MuseScore/pull/1796
I also have fixed pending for the selection rectangle bug.
Fixed in 2a95ecfe78
Automatically closed -- issue fixed for 2 weeks with no activity.