invert up/down move layer buttons
This commit is contained in:
@@ -154,20 +154,6 @@ void NodePanelLayer::init()
|
|||||||
remove_layer(m_current_layer);
|
remove_layer(m_current_layer);
|
||||||
};
|
};
|
||||||
btn_up->on_click = [this](Node*) {
|
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);
|
int old_idx = m_layers_container->get_child_index(m_current_layer);
|
||||||
m_layers_container->move_child_offset(m_current_layer, +1);
|
m_layers_container->move_child_offset(m_current_layer, +1);
|
||||||
int new_idx = m_layers_container->get_child_index(m_current_layer);
|
int new_idx = m_layers_container->get_child_index(m_current_layer);
|
||||||
@@ -181,6 +167,20 @@ void NodePanelLayer::init()
|
|||||||
a->m_offset = +1;
|
a->m_offset = +1;
|
||||||
ActionManager::add(a);
|
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 = find<NodeSliderH>("opacity");
|
||||||
m_opacity->on_value_changed = [this](Node*, float value) {
|
m_opacity->on_value_changed = [this](Node*, float value) {
|
||||||
handle_layer_opacity(m_current_layer, value);
|
handle_layer_opacity(m_current_layer, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user