mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Add LayerGroup::insertLayerBefore
This commit is contained in:
parent
722c74189c
commit
e5bf9cb253
@ -623,6 +623,17 @@ void LayerGroup::insertLayer(Layer* layer, Layer* after)
|
||||
layer->setParent(this);
|
||||
}
|
||||
|
||||
void LayerGroup::insertLayerBefore(Layer* layer, Layer* before)
|
||||
{
|
||||
auto before_it = m_layers.end();
|
||||
if (before) {
|
||||
before_it = std::find(m_layers.begin(), m_layers.end(), before);
|
||||
}
|
||||
m_layers.insert(before_it, layer);
|
||||
|
||||
layer->setParent(this);
|
||||
}
|
||||
|
||||
void LayerGroup::stackLayer(Layer* layer, Layer* after)
|
||||
{
|
||||
ASSERT(layer != after);
|
||||
|
@ -206,6 +206,7 @@ namespace doc {
|
||||
void addLayer(Layer* layer);
|
||||
void removeLayer(Layer* layer);
|
||||
void insertLayer(Layer* layer, Layer* after);
|
||||
void insertLayerBefore(Layer* layer, Layer* before);
|
||||
void stackLayer(Layer* layer, Layer* after);
|
||||
|
||||
Layer* firstLayer() const { return (m_layers.empty() ? nullptr: m_layers.front()); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user