implement brush presets save and restore from file, fix stencil nullptr, limit preview stroke max size

This commit is contained in:
2019-01-23 16:53:58 +01:00
parent e26fcf1163
commit 879be9d4fe
17 changed files with 282 additions and 65 deletions

View File

@@ -62,7 +62,7 @@ void NodePanelStroke::init_controls()
auto b = std::make_shared<Brush>();
int br_idx = m_brush_popup->find_brush("Round-Hard");
b->load_texture(m_brush_popup->get_texture_path(br_idx));
b->load_texture(m_brush_popup->get_texture_path(br_idx), m_brush_popup->get_thumb_path(br_idx));
b->load_stencil("data/paper.jpg");
b->m_tip_size = .1f;
b->m_tip_flow = .5f;
@@ -83,7 +83,7 @@ void NodePanelStroke::init_controls()
m_brush_popup->on_brush_changed = [this](Node*, int index) {
if (on_brush_changed)
on_brush_changed(this, m_brush_popup->get_texture_path(index));
on_brush_changed(this, m_brush_popup->get_texture_path(index), m_brush_popup->get_thumb_path(index));
m_brush_thumb->set_image(m_brush_popup->get_thumb_path(index));
m_brush_popup->mouse_release();
m_brush_popup->parent->remove_child(m_brush_popup.get());