implement brush presets save and restore from file, fix stencil nullptr, limit preview stroke max size
This commit is contained in:
@@ -132,19 +132,20 @@ void App::init_sidebar()
|
||||
// stroke->m_canvas->draw_stroke();
|
||||
// }
|
||||
|
||||
presets->on_brush_changed = [this](Node* target, int index) {
|
||||
auto b = presets->get_brush(index);
|
||||
presets->on_brush_changed = [this](Node* target, std::shared_ptr<Brush>& b) {
|
||||
// don't change some params
|
||||
b->m_tip_size = Canvas::I->m_current_brush->m_tip_size;
|
||||
b->m_tip_color = Canvas::I->m_current_brush->m_tip_color;
|
||||
Canvas::I->m_current_brush = b;
|
||||
*Canvas::I->m_current_brush = *b;
|
||||
stroke->m_preview->draw_stroke();
|
||||
stroke->m_brush_thumb->set_image(b->m_brush_thumb_path);
|
||||
stroke->update_controls();
|
||||
};
|
||||
color->on_color_changed = [this](Node* target, glm::vec4 color) {
|
||||
Canvas::I->m_current_brush->m_tip_color = color;
|
||||
};
|
||||
stroke->on_brush_changed = [this](Node* target, const std::string& path) {
|
||||
Canvas::I->m_current_brush->load_texture(path);
|
||||
stroke->on_brush_changed = [this](Node* target, const std::string& path, const std::string& thumb) {
|
||||
Canvas::I->m_current_brush->load_texture(path, thumb);
|
||||
stroke->m_preview->draw_stroke();
|
||||
};
|
||||
stroke->on_stencil_changed = [this](Node*target, const std::string& path) {
|
||||
|
||||
Reference in New Issue
Block a user