Skip to content

Commit

Permalink
Support @dots with mensural duration (mei-all)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed May 16, 2024
1 parent e747a31 commit dc4b31e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/calcdotsfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ FunctorCode CalcDotsFunctor::VisitChord(Chord *chord)

FunctorCode CalcDotsFunctor::VisitNote(Note *note)
{
// We currently have no dots object with mensural notes
if (note->IsMensuralDur()) {
return FUNCTOR_SIBLINGS;
}
if (!note->IsVisible()) {
return FUNCTOR_SIBLINGS;
}
Expand Down
22 changes: 11 additions & 11 deletions src/preparedatafunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,17 +1161,6 @@ FunctorCode PrepareLayerElementPartsFunctor::VisitNote(Note *note)
}
}

// We don't care about flags or dots in mensural notes
if (note->IsMensuralDur()) return FUNCTOR_CONTINUE;

if (currentStem) {
const bool shouldHaveFlag = ((note->GetActualDur() > DUR_4) && !note->IsInBeam() && !note->GetAncestorFTrem()
&& !note->IsChordTone() && !note->IsTabGrpNote());
currentFlag = this->ProcessFlag(currentFlag, currentStem, shouldHaveFlag);

if (!chord) note->SetDrawingStem(currentStem);
}

/************ dots ***********/

Dots *currentDots = vrv_cast<Dots *>(note->FindDescendantByType(DOTS, 1));
Expand All @@ -1182,6 +1171,17 @@ FunctorCode PrepareLayerElementPartsFunctor::VisitNote(Note *note)
}
currentDots = this->ProcessDots(currentDots, note, shouldHaveDots);

// We don't care about flags in mensural notes
if (note->IsMensuralDur()) return FUNCTOR_CONTINUE;

if (currentStem) {
const bool shouldHaveFlag = ((note->GetActualDur() > DUR_4) && !note->IsInBeam() && !note->GetAncestorFTrem()
&& !note->IsChordTone() && !note->IsTabGrpNote());
currentFlag = this->ProcessFlag(currentFlag, currentStem, shouldHaveFlag);

if (!chord) note->SetDrawingStem(currentStem);
}

/************ Prepare the drawing cue size ************/

PrepareCueSizeFunctor prepareCueSize;
Expand Down
3 changes: 3 additions & 0 deletions src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,9 @@ void View::DrawNote(DeviceContext *dc, LayerElement *element, Layer *layer, Staf

if (note->IsMensuralDur()) {
this->DrawMensuralNote(dc, element, layer, staff, measure);
if (note->FindDescendantByType(DOTS)) {
this->DrawLayerChildren(dc, note, layer, staff, measure);
}
return;
}
if (note->IsTabGrpNote()) {
Expand Down

0 comments on commit dc4b31e

Please sign in to comment.