improving brush tips browser, average stroke direction

This commit is contained in:
2019-01-31 13:56:54 +01:00
parent ff633eb2c8
commit c451acb6bc
8 changed files with 61 additions and 26 deletions

View File

@@ -204,13 +204,19 @@ void NodePanelBrushPreset::init()
m_btn_up = find<NodeButtonCustom>("btn-up");
m_btn_up->on_click = [this](Node*) {
if (m_current)
{
m_container->move_child(m_current, std::max(m_container->get_child_index(m_current) - 1, 0));
save();
}
};
m_btn_down = find<NodeButtonCustom>("btn-down");
m_btn_down->on_click = [this](Node*) {
if (m_current)
m_container->move_child(m_current,
{
m_container->move_child(m_current,
std::min(m_container->get_child_index(m_current) + 1, (int)m_container->m_children.size() - 1));
save();
}
};
m_btn_save = find<NodeButtonCustom>("btn-save");
m_btn_save->on_click = [this](Node*) {
@@ -219,6 +225,7 @@ void NodePanelBrushPreset::init()
*m_current->m_brush = *Canvas::I->m_current_brush;
m_current->m_preview->draw_stroke();
m_current->m_thumb->set_image(m_current->m_brush->m_brush_thumb_path);
save();
}
};
m_btn_delete = find<NodeButtonCustom>("btn-remove");