implementing color wheel and new color picker

This commit is contained in:
2017-11-23 20:26:57 +00:00
parent d44434a458
commit a90aa4a60e
23 changed files with 371 additions and 26 deletions

View File

@@ -57,8 +57,11 @@ void NodeComboBox::loaded()
float offset = 0;
for (int i = 0; i <= m_selected_child_index; i++)
offset += (m_data[i] == "-") ? 5.f : 30.f;
float height = m_items.size() * 30.f + (m_data.size() - m_items.size()) * 5.f; // add items and separators
glm::vec2 pos = m_pos + glm::vec2(0, m_size.y - offset);
auto screen = root()->m_size;
if ((pos.y + height) > screen.y) pos.y = screen.y - height;
if (pos.y < 0) pos.y = 0;
popup->SetPositioning(YGPositionTypeAbsolute);
popup->SetPosition(pos.x, pos.y);
popup->SetSize(m_size.x, YGUndefined);