Skip to content

Commit

Permalink
Calculate clef displacement when inserting custos
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Aug 1, 2024
1 parent ae08e3a commit 1b4fad3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4248,6 +4248,14 @@ bool EditorToolkitNeume::AdjustPitchFromPosition(Object *obj, Clef *clef)
}
pi->SetOct(3);

// The default octave = 3, but the actual octave is calculated by
// taking into account the displacement of the clef
int octave = 3;
if (clef->GetDis() && clef->GetDisPlace()) {
octave += (clef->GetDisPlace() == STAFFREL_basic_above ? 1 : -1) * (clef->GetDis() / 7);
}
pi->SetOct(octave);

const int staffSize = m_doc->GetDrawingUnit(staff->m_drawingStaffSize);

const int pitchDifference
Expand Down

0 comments on commit 1b4fad3

Please sign in to comment.