diff --git a/include/vrv/alignfunctor.h b/include/vrv/alignfunctor.h index 8b9678f522..445a9c3fb2 100644 --- a/include/vrv/alignfunctor.h +++ b/include/vrv/alignfunctor.h @@ -180,6 +180,7 @@ class AlignVerticallyFunctor : public DocFunctor { FunctorCode VisitRunningElement(RunningElement *runningElement) override; FunctorCode VisitStaff(Staff *staff) override; FunctorCode VisitStaffAlignmentEnd(StaffAlignment *staffAlignment) override; + FunctorCode VisitSyllable(Syllable *syllable) override; FunctorCode VisitSystem(System *system) override; FunctorCode VisitSystemEnd(System *system) override; FunctorCode VisitVerse(Verse *verse) override; diff --git a/src/alignfunctor.cpp b/src/alignfunctor.cpp index e6a9fb5fea..25aa777e5f 100644 --- a/src/alignfunctor.cpp +++ b/src/alignfunctor.cpp @@ -678,6 +678,18 @@ FunctorCode AlignVerticallyFunctor::VisitStaffAlignmentEnd(StaffAlignment *staff return FUNCTOR_CONTINUE; } +FunctorCode AlignVerticallyFunctor::VisitSyllable(Syllable *syllable) +{ + if (!syllable->FindDescendantByType(SYL)) return FUNCTOR_CONTINUE; + + StaffAlignment *alignment = m_systemAligner->GetStaffAlignmentForStaffN(m_staffN); + if (!alignment) return FUNCTOR_CONTINUE; + // Current limitation of only one syl (verse n) by syllable + alignment->AddVerseN(1); + + return FUNCTOR_CONTINUE; +} + FunctorCode AlignVerticallyFunctor::VisitSystem(System *system) { m_systemAligner = &system->m_systemAligner;