refactor to have a single global current brush on Canvas::m_current_brush and make panels read from it for drawing instead of relying on their own copy

This commit is contained in:
2017-11-07 09:14:02 +00:00
parent 3e546affc9
commit 53062711fa
13 changed files with 79 additions and 89 deletions

View File

@@ -256,6 +256,11 @@ void App::update(float dt)
layout[main_id]->find<NodeButton>("btn-touchlock")->set_color(
canvas->m_canvas->m_touch_lock ? color_button_hlight : color_button_normal);
stroke->update_controls();
auto pix = ui::Canvas::I->m_current_brush.m_tip_color;
auto hsv = convert_rgb2hsv(glm::vec3(pix[0], pix[1], pix[2]));
color->m_hue->set_value(hsv.x);
color->m_quad->set_value(1.f - hsv.y, 1.f - hsv.z);
auto observer = [this](Node* n)
{