Skip to content

Fix "select similar in range" for spanners #27577

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

Merged

Conversation

cbjeukendrup
Copy link
Member

Nowadays, not Spanners, but SpannerSegments are included in m_selection.elements().

Resolves: #27548

QA note: seems the issue applied to other spanner elements as well (hairpins, text lines, ...); would be good to test those too.

Nowadays, not Spanners, but SpannerSegments are included in `m_selection.elements()`.
@cbjeukendrup cbjeukendrup requested a review from Copilot April 7, 2025 17:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Copy link
Contributor

@mathesoncalum mathesoncalum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved - included a couple of small observations.

Comment on lines 3886 to +3892
if (p->measure) {
auto eMeasure = e->findMeasure();
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 (auto s = toSpannerSegment(e)->spanner()) {
if (auto se = s->startElement()) {
if (auto mse = se->findMeasure()) {
eMeasure = mse;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're at it, we ideally reserve auto for iterators and other complex types right? I think it's unnecessary here.

Also as a bonus I'd love to flatten this nesting a little - perhaps by checking !p-measure and returning early? (maybe that ends up even uglier, its up to you).

@DmitryArefiev
Copy link
Contributor

Tested #27548 on Win10, Mac13.7.2, LinuxUbuntu24.04.2 LTS - FIXED

QA note: seems the issue applied to other spanner elements as well (hairpins, text lines, ...); would be good to test those too.

Yes, they were broken too. Now work fine

@DmitryArefiev DmitryArefiev merged commit de523b1 into musescore:master Apr 14, 2025
11 checks passed
@cbjeukendrup cbjeukendrup deleted the select_similar_in_range_spanners branch April 14, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to select slurs with "similar in this range"
3 participants