-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Same Beat and Measure (Select All Similar Filter) #20137
Same Beat and Measure (Select All Similar Filter) #20137
Conversation
7df14d5
to
3f36308
Compare
Hey Jojo, something I realized since when I implemented that back in late 2019: apparently text-lines don't carry a valid measure property, so that the action fails to give desirable results when using for example a pedal line or crescendo hairpin. The code I used in 3.x locally goes something like this (There's probably a cleaner way than with the compounded if-statements, but safety first and it worked):
void Score::collectMatch(void* data, Element* e)
{
ElementPattern* p = static_cast<ElementPattern*>(data);
+ auto eMeasure = e->findMeasure();
- if (p->measure && (p->measure != e->findMeasure()))
- return;
-
+ if (p->measure) {
+ if (!eMeasure && e->isSpannerSegment()) {
+ if (auto ss = toSpannerSegment(e)){
+ if (auto s = ss->spanner()) {
+ if (auto se = s->startElement()) {
+ if (auto mse = se->findMeasure()) {
+ eMeasure = mse;
+ }}}}
+ }
+ if (p->measure != eMeasure)
+ return;
+ }
- if (sameMeasure->isChecked())
- p->measure = e->findMeasure();
-
+ if (sameMeasure->isChecked()) {
+ auto m = e->findMeasure();
+ if (!m && e->isSpannerSegment()) {
+ if (auto ss = toSpannerSegment(e)) {
+ if (auto s = ss->spanner()) {
+ if (auto se = s->startElement()) {
+ if (auto mse = se->findMeasure()) {
+ m = mse;
+ }}}}
+ }
+ if (m)
+ p->measure = m;
+ } Works over here... |
But that'd be an additional issue and fix, needed for Mu4 and Mu3, right? Also I can't reproduce the problem you describe, neither in 3.6.2 nor in my PR for master Edit: actually I can now reproduce it |
3f36308
to
f928f66
Compare
Continuing on musescore#7421, resp. porting (the rest of) musescore#5637
66a6e68
to
f4f9783
Compare
f4f9783
to
1dcfd5e
Compare
Backport of musescore#20137, part 2, see musescore#20137 (comment)
Backport of musescore#20137, part 2, see musescore#20137 (comment)
Backport of musescore#20137, part 2, see musescore#20137 (comment)
Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved |
It does add stings to translate. Not sure whether that's an issue, but rather mention it 😉 |
@Jojo-Schmitz If you would like to make a 4.2 version too, I think that's fine since this change is low-risk enough (it only touches a relatively self-contained bit of functionality). |
So you'd like a 4.2.0 PR? |
Well, if you're willing to create one, then yes please :) |
Done, see #20187 |
Backport of musescore#20137, part 2, see musescore#20137 (comment)
Continuing on #7421, resp. porting (the rest of) #5637
Resolves: https://musescore.org/en/node/295235
Images of the dialog, the English items are the additions:
The 1st commit brings Mu4 on par with Mu3
The 2nd commit fixes a bug with text lines that exists in Mu3 too