From 266573e9b405f3c9ef2cf8dc2cf24f91126a005d Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 18 Oct 2019 00:12:39 +0200 Subject: [PATCH] frame select layer --- src/node_button_custom.cpp | 2 +- src/node_panel_animation.cpp | 4 +++- src/rtt.cpp | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node_button_custom.cpp b/src/node_button_custom.cpp index 9703c0d..1e0442c 100644 --- a/src/node_button_custom.cpp +++ b/src/node_button_custom.cpp @@ -54,7 +54,7 @@ kEventResult NodeButtonCustom::handle_event(Event* e) switch (e->m_type) { case kEventType::MouseEnter: - m_color = color_hover; + m_color = m_active ? color_active : color_hover; break; case kEventType::MouseLeave: m_color = m_active ? color_active : color_normal; diff --git a/src/node_panel_animation.cpp b/src/node_panel_animation.cpp index 28519b8..91eb1b0 100644 --- a/src/node_panel_animation.cpp +++ b/src/node_panel_animation.cpp @@ -3,6 +3,7 @@ #include "node_button.h" #include "node_button_custom.h" #include "canvas.h" +#include "app.h" Node* NodePanelAnimation::clone_instantiate() const { @@ -78,7 +79,7 @@ void NodePanelAnimation::load_layers() b->set_active(true); m_selected_frame = b.get(); } - b->on_click = [this, fi, lid=layers[i]->id] (Node* target) { + b->on_click = [this, fi, lid=layers[i]->id, i] (Node* target) { auto frame = static_cast(target); if (m_selected_frame) m_selected_frame->set_active(false); @@ -86,6 +87,7 @@ void NodePanelAnimation::load_layers() m_selected_frame = frame; m_selected_frame_layer_id = lid; m_selected_frame_index = fi; + App::I->layers->handle_layer_selected(App::I->layers->get_layer_at(i)); }; } } diff --git a/src/rtt.cpp b/src/rtt.cpp index ae8ec62..8cdd5b0 100644 --- a/src/rtt.cpp +++ b/src/rtt.cpp @@ -56,8 +56,10 @@ RTT::RTT(RTT&& other) RTT::~RTT() { +#ifdef _DEBUG if (valid()) LOG("RTT not destroyed"); +#endif // _DEBUG destroy(); }