fixed a crash when accessing SlurTieSegment::m_ups with an invalid index
when no grip is selected (EditData::curGrip == Grip::NO_GRIP)
This commit is contained in:
parent
ba238d13e3
commit
49a923cdf9
3 changed files with 11 additions and 6 deletions
|
@ -273,6 +273,7 @@ public:
|
|||
bool control(bool textEditing = false) const;
|
||||
bool shift() const { return modifiers & ShiftModifier; }
|
||||
bool isStartEndGrip() { return curGrip == Grip::START || curGrip == Grip::END; }
|
||||
bool hasCurrentGrip() { return curGrip != Grip::NO_GRIP; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -132,9 +132,11 @@ bool SlurSegment::edit(EditData& ed)
|
|||
Slur* sl = slur();
|
||||
|
||||
if (ed.key == Key_Home && !ed.modifiers) {
|
||||
ups(ed.curGrip).off = PointF();
|
||||
renderer()->layoutItem(sl);
|
||||
triggerLayout();
|
||||
if (ed.hasCurrentGrip()) {
|
||||
ups(ed.curGrip).off = PointF();
|
||||
renderer()->layoutItem(sl);
|
||||
triggerLayout();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,9 +83,11 @@ bool TieSegment::edit(EditData& ed)
|
|||
SlurTie* sl = tie();
|
||||
|
||||
if (ed.key == Key_Home && !ed.modifiers) {
|
||||
ups(ed.curGrip).off = PointF();
|
||||
renderer()->layoutItem(sl);
|
||||
triggerLayout();
|
||||
if (ed.hasCurrentGrip()) {
|
||||
ups(ed.curGrip).off = PointF();
|
||||
renderer()->layoutItem(sl);
|
||||
triggerLayout();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue