Skip to content

Commit

Permalink
Set column value for newly inserted staff if has columns
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Dec 1, 2023
1 parent d3d0f8f commit a82d751
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 a82d751

Please sign in to comment.