Skip to content

Commit

Permalink
fix #24635: Wrong octave in note entry after a line break
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Feb 10, 2014
1 parent 1d54c0a commit f345cce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4795,6 +4795,7 @@ void ScoreView::cmdAddPitch(int note, bool addFlag)
else {
int curPitch = -1;
if(is.segment()) {
Staff* staff = score()->staff(is.track() / VOICES);
Segment* seg = is.segment()->prev1(Segment::SegChordRest | Segment::SegClef);
while(seg) {
if(seg->segmentType() == Segment::SegChordRest) {
Expand All @@ -4809,8 +4810,12 @@ void ScoreView::cmdAddPitch(int note, bool addFlag)
Element* p = seg->element( (is.track() / VOICES) * VOICES); // clef on voice 1
if(p && p->type() == Element::CLEF) {
Clef* clef = static_cast<Clef*>(p);
curPitch = line2pitch(4, clef->clefType(), 0); // C 72 for treble clef
break;
// check if it's an actual key change or just a courtesy
ClefType ctb = staff->clef(clef->tick() - 1);
if (ctb != clef->clefType() || clef->tick() == 0) {
curPitch = line2pitch(4, clef->clefType(), 0); // C 72 for treble clef
break;
}
}
}
seg = seg->prev1(Segment::SegChordRest | Segment::SegClef);
Expand Down

0 comments on commit f345cce

Please sign in to comment.