musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.25k stars 2.65k forks source link

Shift+Click (multiple selection) loses first item when performed on clefs #18634

Open worldwideweary opened 1 year ago

worldwideweary commented 1 year ago

See title and demonstration:

Steps to reproduce

  1. Place multiple clefs

  2. Use Shift+Click to select them across a system

  3. Expected: all selected

  4. Result: all save the first one

  5. Going backwards the last one doesn't highlight....

Screenshots/Screen recordings

https://github.com/musescore/MuseScore/assets/7139517/b2e75833-8d35-4fae-8044-0a3536fe615e

Not sure if this applies to other element types, but found this by quickly testing some things in MuseScore 4.1

MuseScore Version

4.1

Regression

Yes, this used to work in MuseScore 3.x and now is broken

Operating system

LNX XFCE

MarcSabatella commented 1 year ago

Actually it's the same in MU3, so not a regression.

To be clear, click / Shift+click of elements other than notes/rests is meant to select similar elements within that range. It works by actually creating a range selection internally from the tick of the first element to the tick of the second, then executing the normal select similar in range function. This doesn't work for clefs because the initial clef won't be part of that range selection. The same will be true for other elements like key signatures or barlines. I suppose the same could be true at the other end of the selection for some element types.

A possible fix would be to explicitly add the two original elements (e and selectedElement) to the selection after the selectSimilarInRange() call here:

https://github.com/musescore/MuseScore/blob/3252e541efdfc671b0cf905fdd85f2a9eb00d917/src/engraving/libmscore/score.cpp#L3517-L3518

worldwideweary commented 1 year ago

Oh, you're right. I'm used to the PRs that got implemented after the team stopped further progress on the 3.x branch and it's easy to forget that I'm not using 3.6.2 at times when something works on my local build :)

MarcSabatella commented 1 year ago

There shouldn’t be any such PR’s merged to any MU3 branch but not an equivalent on master. If you’re sure that happened, best to find that PR and make sure a version is made for master.

worldwideweary commented 1 year ago

I might be wrong. Whatever happens, would be nice to get MS4 more consistent. From a user's perspective, it makes no sense. I think your point of explicitly making sure the initial element prior to forming the range is in the selection would do the trick. This + the lines selection with Shift+click would be nice to get accomplished