Skip to content

Commit

Permalink
fix #59821: shift+letter adds note according to current cursor positi…
Browse files Browse the repository at this point in the history
…on rather than position of added note
  • Loading branch information
lasconic committed May 9, 2015
1 parent 61e912c commit 6356462
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions libmscore/edit.cpp
Expand Up @@ -917,15 +917,15 @@ void Score::cmdAddPitch(int step, bool addFlag)
void Score::addPitch(int step, bool addFlag)
{
Position pos;
pos.segment = inputState().segment();
pos.staffIdx = inputState().track() / VOICES;
ClefType clef = staff(pos.staffIdx)->clef(pos.segment->tick());
pos.line = relStep(step, clef);

if (addFlag) {
Element* el = selection().element();
if (el && el->type() == Element::Type::NOTE) {
Chord* chord = static_cast<Note*>(el)->chord();
Note* selectedNote = static_cast<Note*>(el);
pos.segment = selectedNote->chord()->segment();
pos.staffIdx = selectedNote->track() / VOICES;
ClefType clef = staff(pos.staffIdx)->clef(pos.segment->tick());
pos.line = relStep(step, clef);
Chord* chord = static_cast<Note*>(el)->chord();
bool error;
NoteVal nval = noteValForPosition(pos, error);
if (error)
Expand All @@ -935,7 +935,12 @@ void Score::addPitch(int step, bool addFlag)
return;
}
}


pos.segment = inputState().segment();
pos.staffIdx = inputState().track() / VOICES;
ClefType clef = staff(pos.staffIdx)->clef(pos.segment->tick());
pos.line = relStep(step, clef);

if (inputState().repitchMode())
repitchNote(pos, !addFlag);
else
Expand Down

0 comments on commit 6356462

Please sign in to comment.