diff --git a/src/node_panel_layer.cpp b/src/node_panel_layer.cpp index 91174eb..8f9850e 100644 --- a/src/node_panel_layer.cpp +++ b/src/node_panel_layer.cpp @@ -154,20 +154,6 @@ void NodePanelLayer::init() remove_layer(m_current_layer); }; btn_up->on_click = [this](Node*) { - int old_idx = m_layers_container->get_child_index(m_current_layer); - m_layers_container->move_child_offset(m_current_layer, -1); - int new_idx = m_layers_container->get_child_index(m_current_layer); - if (on_layer_order && old_idx != new_idx) - { - on_layer_order(this, old_idx, new_idx); - } - auto a = new ActionLayerMove; - a->m_panel = this; - a->m_layer_node = m_current_layer->shared_from_this(); - a->m_offset = -1; - ActionManager::add(a); - }; - btn_down->on_click = [this](Node*) { int old_idx = m_layers_container->get_child_index(m_current_layer); m_layers_container->move_child_offset(m_current_layer, +1); int new_idx = m_layers_container->get_child_index(m_current_layer); @@ -181,6 +167,20 @@ void NodePanelLayer::init() a->m_offset = +1; ActionManager::add(a); }; + btn_down->on_click = [this](Node*) { + int old_idx = m_layers_container->get_child_index(m_current_layer); + m_layers_container->move_child_offset(m_current_layer, -1); + int new_idx = m_layers_container->get_child_index(m_current_layer); + if (on_layer_order && old_idx != new_idx) + { + on_layer_order(this, old_idx, new_idx); + } + auto a = new ActionLayerMove; + a->m_panel = this; + a->m_layer_node = m_current_layer->shared_from_this(); + a->m_offset = -1; + ActionManager::add(a); + }; m_opacity = find("opacity"); m_opacity->on_value_changed = [this](Node*, float value) { handle_layer_opacity(m_current_layer, value);