invert up/down move layer buttons

This commit is contained in:
2019-09-01 07:59:48 +02:00
parent 295f85157d
commit 7b66be1e57

View File

@@ -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<NodeSliderH>("opacity");
m_opacity->on_value_changed = [this](Node*, float value) {
handle_layer_opacity(m_current_layer, value);