Skip to content

Commit

Permalink
fix #106146 Crash when pressing LEFT in note entry mode
Browse files Browse the repository at this point in the history
  • Loading branch information
heuchi committed Apr 15, 2016
1 parent 6ee3e88 commit 3d5fdad
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions libmscore/input.cpp
Expand Up @@ -116,18 +116,19 @@ void InputState::moveInputPos(Element* e)
return;

Segment* s;
if (e->isChordRest())
s = static_cast<ChordRest*>(e)->segment();
else
s = static_cast<Segment*>(e);
if (s->type() == Element::Type::SEGMENT) {
if (s->measure()->isMMRest()) {
Measure* m = s->measure()->mmRestFirst();
s = m->findSegment(Segment::Type::ChordRest, m->tick());
}
_lastSegment = _segment;
_segment = s;
if (e->isSegment())
s = toSegment(e);
else if (e->isChordRest())
s = toChordRest(e)->segment();

Q_ASSERT(s);

if (s->measure()->isMMRest()) {
Measure* m = s->measure()->mmRestFirst();
s = m->findSegment(Segment::Type::ChordRest, m->tick());
}
_lastSegment = _segment;
_segment = s;
}

//---------------------------------------------------------
Expand Down

0 comments on commit 3d5fdad

Please sign in to comment.