Skip to content

Commit

Permalink
Fix nc and staff jumping after staff dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Jul 31, 2024
1 parent 1c02c63 commit dc8ed7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/calcligatureorneumeposfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,14 @@ FunctorCode CalcLigatureOrNeumePosFunctor::VisitNeume(Neume *neume)
}

// If the nc overlaps with the previous, move it back from a line width
if (overlapWithPrevious) {
if (overlapWithPrevious && !m_doc->HasFacsimile()) {
xRel -= lineWidth;
}

nc->SetDrawingXRel(xRel);
// The first glyph set the spacing - unless we are starting a ligature, in which case no spacing should be added
// between the two nc
if (!previousLig) {
if (!previousLig && !m_doc->HasFacsimile()) {
xRel += m_doc->GetGlyphWidth(nc->m_drawingGlyphs.at(0).m_fontNo, staffSize, false);
}

Expand Down
1 change: 1 addition & 0 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y)

SortStaves();

m_doc->GetDrawingPage()->ResetAligners();
if (m_doc->IsTranscription() && m_doc->HasFacsimile()) m_doc->SyncFromFacsimileDoc();

return true; // Can't reorder by layer since staves contain layers
Expand Down
7 changes: 7 additions & 0 deletions src/page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ void Page::ResetAligners()
AlignVerticallyFunctor alignVertically(doc);
this->Process(alignVertically);

if (doc->IsNeumeLines()) {
AdjustXRelForTranscriptionFunctor adjustXRelForTranscription;
this->Process(adjustXRelForTranscription);
AdjustYRelForTranscriptionFunctor adjustYRelForTranscription;
this->Process(adjustYRelForTranscription);
}

// Unless duration-based spacing is disabled, set the X position of each Alignment.
// Does non-linear spacing based on the duration space between two Alignment objects.
if (!doc->GetOptions()->m_evenNoteSpacing.GetValue()) {
Expand Down

0 comments on commit dc8ed7d

Please sign in to comment.