diff --git a/src/node_combobox.cpp b/src/node_combobox.cpp index fefa424..62ebd59 100644 --- a/src/node_combobox.cpp +++ b/src/node_combobox.cpp @@ -30,6 +30,7 @@ void NodeComboBox::loaded() popup->loaded(); root()->add_child(popup); m_items.clear(); + int real_index = 0; for (int i = 0; i < m_data.size(); i++) { if (m_data[i] == "-") @@ -46,6 +47,8 @@ void NodeComboBox::loaded() btn->m_border->SetWidthP(100.f); btn->m_border->SetHeight(30.f); int index = (int)m_items.size(); + if (index == m_current_index) + m_selected_child_index = popup->get_child_index(btn); m_items.push_back(m_data[i]); btn->on_click = [this,popup,btn,index](Node* target) { m_current_index = index; @@ -103,7 +106,6 @@ void NodeComboBox::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* void NodeComboBox::set_index(int index) { m_current_index = index; - m_selected_child_index = index; m_text->set_text(m_items[index].c_str()); //if (on_select) // on_select(this, index); diff --git a/src/node_stroke_preview.cpp b/src/node_stroke_preview.cpp index 09df855..b5a0bf8 100644 --- a/src/node_stroke_preview.cpp +++ b/src/node_stroke_preview.cpp @@ -378,7 +378,7 @@ void NodeStrokePreview::draw_stroke() // copy background color to tex2 ShaderManager::use(kShader::Checkerboard); - ShaderManager::u_int(kShaderUniform::Colorize, b->m_tip_mix > 0.f); + ShaderManager::u_int(kShaderUniform::Colorize, b->m_tip_mix > 0.f || b->m_blend_mode != 0); float aspect = size.x / size.y; ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f / aspect, .5f / aspect, -1.f, 1.f)); m_plane.draw_fill();