Skip to content
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

Fix crash on selecting arpeggio #26010

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Jan 7, 2025

Resolves: #26396
Crash on selecting arpeggio. I'm not sure when this slipped in, but it only occurs in master.

@oktophonie oktophonie added the crash Issues involving a crash of MuseScore label Jan 7, 2025

const PointF gripCanvasPos = gripsPositions()[static_cast<int>(grip)] + pageOffset;
if (gripIndex >= gripsCount()) {
return result;
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to have this check, in any case. But I would also like this to be fixed higher up, namely in NotationViewInputController::handleLeftClick, where we startEditGrip on a default grip which happens to be the MIDDLE grip, which isn't available for Arpeggios. The most elegant solution I can think of would be to introduce something like a
virtual Grip defaultGrip() const;
which every EngravingItem can specify for itself. Or even without making it virtual, it could just be in EngravingItem and return a sensible choice depending on the gripCount.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a virtual defaultGrip method already - seems it just isn't being used here. I'll update handleLeftClick to use that grip.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ha! Lol, didn't know. Good job!

@mike-spa mike-spa merged commit 2373dff into musescore:master Feb 7, 2025
11 checks passed
@oktophonie oktophonie mentioned this pull request Feb 8, 2025
4 tasks
@oktophonie oktophonie removed the crash Issues involving a crash of MuseScore label Feb 8, 2025
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.

Crash when clicking on arpeggio
3 participants