Skip to content

Commit

Permalink
Merge pull request #3689 from rism-digital/develop-neon
Browse files Browse the repository at this point in the history
Integrate latest changes for neon
  • Loading branch information
lpugin authored May 22, 2024
2 parents 3955188 + 765a124 commit 971ecf7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
26 changes: 14 additions & 12 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1588,19 +1588,26 @@ bool EditorToolkitNeume::DisplaceClefOctave(std::string elementId, std::string d
clef->SetDisPlace(octaveDis > 0 ? STAFFREL_basic_above : STAFFREL_basic_below);
}

// Set new octaves for affected neume components
// Set new octaves for affected neume components and custodes
ClassIdComparison equalsClef(CLEF);
Clef *nextClef = dynamic_cast<Clef *>(page->FindNextChild(&equalsClef, clef));

ClassIdComparison equalsNcs(NC);
ListOfObjects ncs;
page->FindAllDescendantsBetween(&ncs, &equalsNcs, clef, nextClef);

std::for_each(ncs.begin(), ncs.end(), [&](Object *ncObj) {
Nc *nc = dynamic_cast<Nc *>(ncObj);
nc->SetOct(nc->GetOct() + move);
});

ClassIdComparison equalsCustodes(CUSTOS);
ListOfObjects custodes;
page->FindAllDescendantsBetween(&custodes, &equalsCustodes, clef, nextClef);
std::for_each(custodes.begin(), custodes.end(), [&](Object *custosObj) {
Custos *custos = dynamic_cast<Custos *>(custosObj);
custos->SetOct(custos->GetOct() + move);
});

m_editInfo.import("status", "OK");
m_editInfo.import("message", "");
return true;
Expand Down Expand Up @@ -2060,13 +2067,10 @@ bool EditorToolkitNeume::SortStaves()
Object *pbParent = pb->GetParent();
Object *milestoneEndParent = milestoneEnd->GetParent();
Object *sectionParent = section->GetParent();
int pbIdx = pbParent->GetChildIndex(pb);
int milestoneEndIdx = milestoneEndParent->GetChildIndex(milestoneEnd);
int sectionIdx = sectionParent->GetChildIndex(section);

pb = pbParent->DetachChild(pbIdx);
milestoneEnd = milestoneEndParent->DetachChild(milestoneEndIdx);
section = sectionParent->DetachChild(sectionIdx);
pb = pbParent->DetachChild(pb->GetIdx());
milestoneEnd = milestoneEndParent->DetachChild(milestoneEnd->GetIdx());
section = sectionParent->DetachChild(section->GetIdx());

Object *firstSystem = page->GetFirst(SYSTEM);
Object *lastSystem = page->GetLast(SYSTEM);
Expand Down Expand Up @@ -2322,10 +2326,8 @@ bool EditorToolkitNeume::Remove(std::string elementId)
assert(pb);
assert(section);

int sectionIdx = system->GetChildIndex(section);
int pbIdx = system->GetChildIndex(pb);
section = system->DetachChild(sectionIdx);
pb = system->DetachChild(pbIdx);
section = system->DetachChild(section->GetIdx());
pb = system->DetachChild(pb->GetIdx());

nextSystem->InsertChild(section, 0);
nextSystem->InsertChild(pb, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Measure::Measure(MeasureType measureMusic, int logMeasureNb)

this->Reset();

if (!this->IsMeasuredMusic()) this->SetRight(BARRENDITION_invis);
if (!this->IsMeasuredMusic() && !this->IsNeumeLine()) this->SetRight(BARRENDITION_invis);
}

Measure::~Measure()
Expand Down
2 changes: 1 addition & 1 deletion src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ void View::DrawSyl(DeviceContext *dc, LayerElement *element, Layer *layer, Staff
return;
}

if (!m_doc->IsFacs()) {
if (!m_doc->IsFacs() && !m_doc->IsNeumeLines()) {
syl->SetDrawingYRel(this->GetSylYRel(syl->m_drawingVerse, staff));
}

Expand Down

0 comments on commit 971ecf7

Please sign in to comment.