diff --git a/src/calcligatureorneumeposfunctor.cpp b/src/calcligatureorneumeposfunctor.cpp index a13226e6cf..efefc3dc3f 100644 --- a/src/calcligatureorneumeposfunctor.cpp +++ b/src/calcligatureorneumeposfunctor.cpp @@ -347,16 +347,19 @@ FunctorCode CalcLigatureOrNeumePosFunctor::VisitNeume(Neume *neume) } } - // If the nc overlaps with the previous, move it back from a line width - if (overlapWithPrevious) { - xRel -= lineWidth; - } + // xRel remains unset with facsimile + if (!m_doc->HasFacsimile()) { + // If the nc overlaps with the previous, move it back from a line width + if (overlapWithPrevious) { + 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) { - xRel += m_doc->GetGlyphWidth(nc->m_drawingGlyphs.at(0).m_fontNo, staffSize, false); + 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) { + xRel += m_doc->GetGlyphWidth(nc->m_drawingGlyphs.at(0).m_fontNo, staffSize, false); + } } previousNc = nc; diff --git a/src/editortoolkit_neume.cpp b/src/editortoolkit_neume.cpp index 341b04c5aa..8d6f62e506 100644 --- a/src/editortoolkit_neume.cpp +++ b/src/editortoolkit_neume.cpp @@ -679,6 +679,7 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) SortStaves(); + m_doc->GetDrawingPage()->LayOutTranscription(true); if (m_doc->IsTranscription() && m_doc->HasFacsimile()) m_doc->SyncFromFacsimileDoc(); return true; // Can't reorder by layer since staves contain layers diff --git a/src/page.cpp b/src/page.cpp index f336123d74..17388407eb 100644 --- a/src/page.cpp +++ b/src/page.cpp @@ -253,6 +253,9 @@ void Page::LayOutTranscription(bool force) CalcAlignmentPitchPosFunctor calcAlignmentPitchPos(doc); this->Process(calcAlignmentPitchPos); + CalcLigatureOrNeumePosFunctor calcLigatureOrNeumePos(doc); + this->Process(calcLigatureOrNeumePos); + CalcStemFunctor calcStem(doc); this->Process(calcStem); @@ -262,13 +265,15 @@ void Page::LayOutTranscription(bool force) CalcDotsFunctor calcDots(doc); this->Process(calcDots); - // Render it for filling the bounding box - View view; - view.SetDoc(doc); - BBoxDeviceContext bBoxDC(&view, 0, 0, BBOX_HORIZONTAL_ONLY); - // Do not do the layout in this view - otherwise we will loop... - view.SetPage(this->GetIdx(), false); - view.DrawCurrentPage(&bBoxDC, false); + if (!m_layoutDone) { + // Render it for filling the bounding box + View view; + view.SetDoc(doc); + BBoxDeviceContext bBoxDC(&view, 0, 0, BBOX_HORIZONTAL_ONLY); + // Do not do the layout in this view - otherwise we will loop... + view.SetPage(this->GetIdx(), false); + view.DrawCurrentPage(&bBoxDC, false); + } AdjustXRelForTranscriptionFunctor adjustXRelForTranscription; this->Process(adjustXRelForTranscription);