Merge branch 'master'

This commit is contained in:
David Capello 2018-06-22 16:21:41 -03:00
commit 58b9dfed11
3 changed files with 14 additions and 2 deletions

View File

@ -118,9 +118,11 @@ void NewFrameCommand::onExecute(Context* context)
SelectedLayers selLayers;
if (site->inFrames())
selLayers.selectAllLayers(writer.sprite()->root());
else
else {
selLayers = site->selectedLayers();
selLayers.expandCollapsedGroups();
}
frame_t frameRange =
(site->selectedFrames().lastFrame() -
site->selectedFrames().firstFrame() + 1);

View File

@ -106,6 +106,15 @@ void SelectedLayers::selectAllLayers(LayerGroup* group)
}
}
void SelectedLayers::expandCollapsedGroups()
{
auto copy = m_set;
for (Layer* layer : copy) {
if (layer->isGroup() && layer->isCollapsed())
selectAllLayers(static_cast<LayerGroup*>(layer));
}
}
void SelectedLayers::displace(layer_t layerDelta)
{
// Do nothing case

View File

@ -41,6 +41,7 @@ namespace doc {
LayerList toLayerList() const;
void removeChildrenIfParentIsSelected();
void expandCollapsedGroups();
void selectAllLayers(LayerGroup* group);
void displace(layer_t layerDelta);