fix color on mode change
This commit is contained in:
@@ -25,7 +25,7 @@ void NodePanelQuick::init()
|
||||
|
||||
void NodePanelQuick::set_color(glm::vec3 color)
|
||||
{
|
||||
static_cast<NodeBorder*>(m_button_color_current->m_children[0].get())->m_color = glm::vec4(color, 1.f);
|
||||
m_button_color_current_inner->m_color = glm::vec4(color, 1.f);
|
||||
}
|
||||
|
||||
void NodePanelQuick::init_controls()
|
||||
@@ -81,6 +81,7 @@ void NodePanelQuick::init_controls()
|
||||
m_button_color3 = find<NodeButtonCustom>("quick-color3");
|
||||
m_button_color_current = m_button_color1;
|
||||
m_button_color_current->set_active(true);
|
||||
m_button_color_current_inner = static_cast<NodeBorder*>(m_button_color_current->m_children[0].get());
|
||||
m_button_color1->on_click = std::bind(&this_class::handle_button_color_click, this, std::placeholders::_1);
|
||||
m_button_color2->on_click = std::bind(&this_class::handle_button_color_click, this, std::placeholders::_1);
|
||||
m_button_color3->on_click = std::bind(&this_class::handle_button_color_click, this, std::placeholders::_1);
|
||||
@@ -176,8 +177,9 @@ void NodePanelQuick::handle_button_color_click(Node* target)
|
||||
button->set_active(true);
|
||||
m_button_color_current->set_active(false);
|
||||
m_button_color_current = button;
|
||||
m_button_color_current_inner = static_cast<NodeBorder*>(m_button_color_current->m_children[0].get());
|
||||
if (on_color_change)
|
||||
on_color_change(this, static_cast<NodeBorder*>(button->m_children[0].get())->m_color);
|
||||
on_color_change(this, m_button_color_current_inner->m_color);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user