Skip to content

Commit

Permalink
Merge pull request #116 from DDMAL/multicol
Browse files Browse the repository at this point in the history
Set column value for newly inserted staff if has columns
  • Loading branch information
yinanazhou authored Dec 5, 2023
2 parents d3d0f8f + a82d751 commit 2fe5306
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,12 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in
if (elementType == "staff") {
Object *parent;
Staff *newStaff;
std::string columnValue;
// Use closest existing staff (if there is one)
if (staff) {
parent = staff->GetParent();
assert(parent);
columnValue = staff->GetType();
int n = parent->GetChildCount() + 1;
newStaff = new Staff(n);
newStaff->m_drawingStaffDef = staff->m_drawingStaffDef;
Expand All @@ -810,6 +812,7 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in
assert(surface);
surface->AddChild(zone);
newStaff->AttachZone(zone);
if (columnValue.length()) newStaff->SetType(columnValue);
Layer *newLayer = new Layer();
newStaff->AddChild(newLayer);

Expand Down

0 comments on commit 2fe5306

Please sign in to comment.