combobox selected element alignment, brush preview

This commit is contained in:
2019-02-22 02:44:18 +01:00
parent 876c002616
commit cb2b1b5aa2
2 changed files with 4 additions and 2 deletions

View File

@@ -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);

View File

@@ -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();