From 7b66be1e578fac24f3c9371b0b72e407c9bd5ad7 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sun, 1 Sep 2019 07:59:48 +0200 Subject: [PATCH] invert up/down move layer buttons --- src/node_panel_layer.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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);