fix layer order change
This commit is contained in:
@@ -1295,7 +1295,18 @@ void Canvas::layer_remove(int idx) // m_order index
|
||||
}
|
||||
void Canvas::layer_order(int idx, int pos) // m_order index
|
||||
{
|
||||
std::swap(m_layers[idx], m_layers[pos]);
|
||||
auto from = m_layers.begin() + idx;
|
||||
auto to = m_layers.begin() + pos;
|
||||
|
||||
if (pos < idx)
|
||||
std::rotate(to, from, from + 1);
|
||||
if (pos > idx)
|
||||
std::rotate(from, from + 1, to + 1);
|
||||
|
||||
if (m_current_layer_idx == idx)
|
||||
m_current_layer_idx = pos;
|
||||
else if (m_current_layer_idx == pos)
|
||||
m_current_layer_idx = idx;
|
||||
}
|
||||
void Canvas::layer_merge(int source_idx, int dest_idx) // m_layer index
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user