Skip to content

Commit

Permalink
Break loop when reach end of syllable
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Feb 16, 2024
1 parent c446f37 commit f81a769
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,7 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector<std::string>
ListOfObjects syllables; // List of syllables used. groupType=neume only.

jsonxx::Array uuidArray;
bool breakOnEnd = false;

// Check if you can get drawing page
if (!m_doc->GetDrawingPage()) {
Expand Down Expand Up @@ -2920,10 +2921,15 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector<std::string>
fparent->ReorderByXPos();
uuidArray << (*it);
it = elementIds.erase(it);
if (it == elementIds.end()) break;
if (it == elementIds.end()) {
breakOnEnd = true;
break;
}
el = m_doc->GetDrawingPage()->FindDescendantByID(*it);
}
}
if (breakOnEnd) break;

if (elementIds.begin() == it || firstIsSyl) {
// if the element is a syl we want it to stay attached to the first element
// we'll still need to initialize all the parents, thus the bool
Expand Down

0 comments on commit f81a769

Please sign in to comment.