Skip to content

Commit

Permalink
Avoid overlap with label and verse. Fixes #1845
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Oct 31, 2023
1 parent 00c6c9c commit 938ab77
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/adjustsylspacingfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//----------------------------------------------------------------------------

#include "doc.h"
#include "label.h"
#include "labelabbr.h"
#include "staff.h"
#include "syl.h"
Expand Down Expand Up @@ -168,6 +169,12 @@ FunctorCode AdjustSylSpacingFunctor::VisitVerse(Verse *verse)
int overlap = m_lastSyl->GetContentRight() - (firstSyl->GetContentLeft() + xShift);
overlap += m_lastSyl->CalcConnectorSpacing(m_doc, m_staffSize);

// Check that we also include the space for the label if the verse has a new label
Label *label = vrv_cast<Label *>(verse->FindDescendantByType(LABEL));
if (label) {
overlap += (label->GetContentX2() - label->GetContentX1()) + m_doc->GetDrawingDoubleUnit(m_staffSize);
}

int nextFreeSpace = m_previousVerse->AdjustPosition(overlap, m_freeSpace, m_doc);

if (overlap > 0) {
Expand Down

0 comments on commit 938ab77

Please sign in to comment.