Selection rectangle encompasses full measure if voice 1 is empty and other voice only partially selected

• Mar 28, 2015 - 15:29
Type
Functional
Severity
3
Status
active
Project

MuseScore 2.0 /Windows7

1) Open this file: test file.mscz
2) Select the tuplets one after the other

Expected result, eg. Produced with this Nightly: d9e3e93

selection.jpg
Current result. Produced with this Nightly: daf802e
result1.jpg
There is few commits between this two Nightlies. The cause might be here? https://github.com/musescore/MuseScore/commit/15fcfea88e9d84a84bb20a4e2…

To fix: #42881: Selection rectangle does not encompass empty measure if any staff has notes


Comments

Severity

The file you attached doesn't look like the picture, and I'm not quite sure what you mean by "select the tuplets one after the other". But I *think* I understand what you are doing - you have a tuplet, and you tried to select a range containing only the first two notes of the group. The same thing happens for ordinary notes - it is not specific to tuplets.

If you are selecting notes in voice > 1 individually by Ctrl+click, then the full measure rest in voice 1 would not be selected. But if you are selecting a *range* - then this range does include the full measure rest. And that is the bug that the commit in question was fixing - your "expected" result is actully incorrect, as it does not show the full measure rest as being within the rectangle even though it is selected.

When a measure contains multiple voices with different rhythms, it is sometimes impossible to draw a rectangle that exactly contains only the selected notes. Previously, the rectangle was often too small. Now it is occasionally too big, but still, you can tell by the color of the highlighting within the rectangle what is actually selected and what is not.

I guess a fix would be to try to sort out the multiple voices and only extend the rectangle as far as the position of the actual measure rest. Still, I'd rather have the rectangle too big than too small.

"The file you attached doesn't look like the picture":
Because the picture has been done in a previous test, that's all!

"I'm not quite sure what you mean by "select the tuplets one after the other".
Simply I select eg the first note of one tuplet, then, the last note, by hitting Shift key

The same thing happens for ordinary notes - it is not specific to tuplets.
True.

My aim is only to show that before February 21, I could select exactly a range of notes of my choice in voices 2, 3 and 4. To achieve this result, eg:
8th .jpg
And now, the selection includes the entire measure. This may be a bit surprising when you copy and paste: you can feel that all the measure will be copied and pasted (or by "Repeat" operation).
8th 1.jpg

All I want to emphasize is that the expected result is, in my opinion, the first (I select the first and last note of a tuplet, and these notes, and only these, are selected), not the second result (with selection of all the measure, at least as can let it think the position of the rectangle)

OK, but what I am saying is this: in both cases, only the notes you want are selected. That is, there is *no difference* between the two cases in what is actually selected. The only difference is *how the recetangle is drawn". Previously, it was too small - it failed to encompass the measure rest in voice 1, even though it is actually selected. Now, it is too big - it encompasses the rests in voice 2, even though they are not actually selected. In your original example, it would have been physically impossible to draw a rectangle that actually included just the selection, because if we make the rectangle big enough to include the measure rest, then it would have included notes in the tuplet that was not selected.

There's just no way a simnple rectangle can always exactly capture exactly what is selected and what is not. That is why we *also* use color to tell you what is selected and what is not, so if the rectangle is too small or too large, you still have a way of telling which items are actually selected. The rectangle is just a rough guide; there are actually many cases where it might encompass elements that are not actually selected (eg, use the selection filter to exclude elements) as well as many other cases where it fails to encompass elements that are selected (eg, have notes far above the staff, also thinking about chord symbols, lyrics, etc).

But again, there is no change in what is *actually selected* - just in how the rectangle is drawn. Both before and after the change, the full measure rest in voice 1 *is* selected (even though it was previously outside the rectangle), and the rests in voice 2 are *not* selected (even though they are now within the rectangle). There is simply no way to draw a rectangle that actually captures what is selected and what is not in all cases - it would need to be a much more complex shape.

But that isn't to say we couldn't poerhaps find a way to make a better rectangle in this particular case, hopefully without making other cases worse. Which is why I am leaving this open. But I have marked it "minor", because again, the selection itself is totally correct, as is the feedback you get from the color of the elements (the unselected rests are black; they would have been colored had they been truly selected). Only the shape of the rectangle is in question, and only in cases where it is fact difficult or impossible to get "right" with a simple rectangle.

"But again, there is no change in what is *actually selected* - just in how the rectangle is drawn."
Absolutely. I quite understand that.
But I want simply point out that there is now inconsistency (so: with some misunderstanding or confusion maybe) in selection according to the different voices.
What I can do with Voice1 (as always), see example,
voice1.jpg
triplet.jpg
I can not get it (since February 21) with the other voices, 2, 3 and 4
voice 2.jpg
voice4.jpg

The last is a good example. There is no physical way to draw a rectangle that would include only what is selected: the three notes of the second voice triplet and the first voice measure rest.

Blame whomever decided it would be a good idea to center measure rests! :-) That is what makes this impossible in some case, difficult in others.

Not sure to understand everything, sorry.
That's what I always received on the Beta1 and the Beta2 and others until the end of February.

voice2.jpg
voice 4.jpg

Look at the second picture you just posted. The full measure rest in voice 1 is selected - that is why it is blue. And yet, it is not included in the rectangle. This is what I mean when I say that previously, the rectangle was often too small. In other words, the picture you show is *wrong*. So is the current result. But that is simply unavoidable. It is *physically impossible* to draw a rectangle that includes the three notes of the triplet in voice 2 and the full measure rest in voice 1 without also encompassing at least the quarter rest in voice 2.

Because of this and the other cases I mentioned, you cannot simply assume that everything inside the rectangle is selected and everything outside the rectangle is not. This will not always be true. You must pay attention to the color of the items to understand what is actually selected and what is not. And again, this has not changed. The actual selection in all of these cases is exactly the same as it always has been. it is just that sometimes before, we drew rectangles too small, and sometimes now, we draw them too big. But once more, it is *impossible* to draw a correct rectangle in all cases.

Sorry I don't speak French or I would try to explain in your native language!

If it helps make what I am saying more clear, this is what the selection actually looks like:

selection.png

That is, it includes the triplet in voice 2 *and* the full measure rest in voice 1. This has always been true; nothing has change since the beta releases here. But as you can see, there is no way to draw a single rectangle to do that. So previously we drew it too small - the voice 1 rest was excluded, even though it was actually selected. Now we draw it too big - the voice 2 rests are included, even though they are not actually selected. It is *physically impossible* to draw a single rectangle that accurately describes the selection. And this is an unavoidable consequence of the fact that the full measure rest in voice 1 has to be centered.

Now, previously, we drew the rectangle too msall in a *lot* of cases. i fixed that so we never draw too small. But in a few cases, we draw too big even where it might be possible to make the rectangle a *little* smaller. So again, that is why I am leaving the bug report open. But I hope you understand, the actual selection is fine - you can select exactly what you want to select. The problem is only that in some certain cases, the rectangle will be drawn too big, but your selection is fine. Just as the selection was fine when the rectangle was drawn too small in the beta.

You're welcome! And I will see what I can do to improve the rectangle in the cases where it is not actually *impossible*. But given the possibility of notes in other staves as well, it's a more complicated problem than it may have looked at first.