implemented brush settings switch between pen/erase

This commit is contained in:
2017-09-28 22:30:47 +01:00
parent b4b9cf2a7c
commit 763e446cc5
7 changed files with 44 additions and 10 deletions

View File

@@ -81,3 +81,18 @@ uint16_t NodePanelBrush::get_texture_id(int index) const
{
return m_brushes[index]->img->m_tex_id;
}
// select the current brush based on the texture id
void NodePanelBrush::set_texture_id(int texid)
{
if (m_current)
m_current->m_selected = false;
for (auto b : m_brushes)
{
if (b->img->m_tex_id == texid)
{
b->m_selected = true;
m_current = b;
}
}
}