mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-11-15 03:36:53 -06:00
Support nested macro groups in undo / redo and import / export
This commit is contained in:
@@ -798,27 +798,7 @@ std::vector<std::shared_ptr<Macro>> MacroTree::GetCurrentMacros() const
|
||||
|
||||
std::vector<std::shared_ptr<Macro>> MacroTree::GetSelectedSubtreeRoots() const
|
||||
{
|
||||
auto selected = GetCurrentMacros();
|
||||
std::vector<std::shared_ptr<Macro>> roots;
|
||||
for (const auto ¯o : selected) {
|
||||
const bool hasSelectedAncestor = std::any_of(
|
||||
selected.begin(), selected.end(),
|
||||
[¯o](const std::shared_ptr<Macro> &other) {
|
||||
return IsMacroInGroup(macro.get(), other.get());
|
||||
});
|
||||
if (!hasSelectedAncestor) {
|
||||
roots.emplace_back(macro);
|
||||
}
|
||||
}
|
||||
|
||||
auto treeModel = GetModel();
|
||||
std::sort(roots.begin(), roots.end(),
|
||||
[treeModel](const std::shared_ptr<Macro> &a,
|
||||
const std::shared_ptr<Macro> &b) {
|
||||
return treeModel->PositionOf(a.get()) <
|
||||
treeModel->PositionOf(b.get());
|
||||
});
|
||||
return roots;
|
||||
return GetOutermostMacros(GetCurrentMacros());
|
||||
}
|
||||
|
||||
bool MacroTree::GroupsSelected() const
|
||||
|
||||
Reference in New Issue
Block a user