Skip to content

Commit

Permalink
Fix musescore#20146 - issues with home key on slurs
Browse files Browse the repository at this point in the history
  • Loading branch information
wizofaus committed Jun 5, 2024
1 parent 8173087 commit 435b482
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/engraving/dom/slur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static ChordRest* searchCR(Segment* segment, track_idx_t startTrack, track_idx_t

bool SlurSegment::isEditAllowed(EditData& ed) const
{
if (ed.key == Key_Home && !ed.modifiers) {
if (ed.key == Key_Home && !ed.modifiers && ed.hasCurrentGrip()) {
return true;
}

Expand All @@ -110,6 +110,8 @@ bool SlurSegment::isEditAllowed(EditData& ed) const
// return true if event is accepted
//---------------------------------------------------------

#pragma optimize("", off)

bool SlurSegment::edit(EditData& ed)
{
if (!isEditAllowed(ed)) {
Expand All @@ -120,9 +122,15 @@ bool SlurSegment::edit(EditData& ed)

if (ed.key == Key_Home && !ed.modifiers) {
if (ed.hasCurrentGrip()) {
ups(ed.curGrip).off = PointF();
startEditDrag(ed);
if (ed.curGrip == Grip::SHOULDER) {
ups(Grip::BEZIER1).off = PointF();
ups(Grip::BEZIER2).off = PointF();
} else {
ups(ed.curGrip).off = PointF();
}
renderer()->layoutItem(sl);
triggerLayout();
endEditDrag(ed);
}
return true;
}
Expand Down

0 comments on commit 435b482

Please sign in to comment.