Skip to content

Commit

Permalink
Merge pull request rism-digital#3727 from rism-digital/develop-neon
Browse files Browse the repository at this point in the history
Fix alignment of clefs within layers
  • Loading branch information
lpugin authored Jul 8, 2024
2 parents 86c98d4 + 84d9967 commit 036a84c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/vrv/adjustxposfunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class AdjustXPosFunctor : public DocFunctor {
int m_staffN;
// The current staff size
int m_staffSize;
// The current staff is neume
bool m_isNeumeStaff;
// The list of staffN in the top-level scoreDef
std::vector<int> m_staffNs;
// The bounding boxes in the previous aligner
Expand Down
3 changes: 2 additions & 1 deletion src/adjustxposfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ FunctorCode AdjustXPosFunctor::VisitLayerElement(LayerElement *layerElement)
return FUNCTOR_SIBLINGS;
}

if (layerElement->GetAlignment()->GetType() == ALIGNMENT_CLEF) {
if ((layerElement->GetAlignment()->GetType() == ALIGNMENT_CLEF) && !m_isNeumeStaff) {
return FUNCTOR_CONTINUE;
}

Expand Down Expand Up @@ -232,6 +232,7 @@ FunctorCode AdjustXPosFunctor::VisitMeasure(Measure *measure)
m_currentAlignment.Reset();
StaffAlignment *staffAlignment = system->m_systemAligner.GetStaffAlignmentForStaffN(staffN);
m_staffSize = (staffAlignment) ? staffAlignment->GetStaffSize() : 100;
m_isNeumeStaff = (staffAlignment && staffAlignment->GetStaff()) ? staffAlignment->GetStaff()->IsNeume() : false;

// Prevent collisions of scoredef clefs with thick barlines
if (hasSystemStartLine) {
Expand Down
2 changes: 1 addition & 1 deletion src/alignfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ FunctorCode AlignHorizontallyFunctor::VisitMeasureEnd(Measure *measure)

if (m_hasMultipleLayer) measure->HasAlignmentRefWithMultipleLayers(true);

measure->m_measureAligner.LogDebugTree(3);
// measure->m_measureAligner.LogDebugTree(3);

return FUNCTOR_CONTINUE;
}
Expand Down

0 comments on commit 036a84c

Please sign in to comment.