fix brush selection handler
This commit is contained in:
@@ -134,23 +134,23 @@ void App::init_sidebar()
|
|||||||
// stroke->m_canvas->draw_stroke();
|
// stroke->m_canvas->draw_stroke();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// brushes->on_brush_changed = [this](Node* target, int index) {
|
brushes->on_brush_changed = [this](Node* target, int index) {
|
||||||
// ui::Canvas::I->m_current_brush.m_tex_id = brushes->get_texture_id(index);
|
ui::Canvas::I->m_current_brush.m_tex_id = brushes->get_texture_id(index);
|
||||||
// ui::Canvas::I->m_current_brush.id = brushes->get_brush_id(index);
|
ui::Canvas::I->m_current_brush.id = brushes->get_brush_id(index);
|
||||||
// stroke->m_canvas->draw_stroke();
|
stroke->m_preview->draw_stroke();
|
||||||
// };
|
};
|
||||||
presets->on_brush_changed = [this](Node* target, int index) {
|
presets->on_brush_changed = [this](Node* target, int index) {
|
||||||
auto b = presets->get_brush(index);
|
auto b = presets->get_brush(index);
|
||||||
// don't change some params
|
// don't change some params
|
||||||
b.m_tip_size = ui::Canvas::I->m_current_brush.m_tip_size;
|
b.m_tip_size = ui::Canvas::I->m_current_brush.m_tip_size;
|
||||||
b.m_tip_color = ui::Canvas::I->m_current_brush.m_tip_color;
|
b.m_tip_color = ui::Canvas::I->m_current_brush.m_tip_color;
|
||||||
ui::Canvas::I->m_current_brush = b;
|
ui::Canvas::I->m_current_brush = b;
|
||||||
|
stroke->m_preview->draw_stroke();
|
||||||
};
|
};
|
||||||
|
|
||||||
// color->on_color_changed = [this](Node* target, glm::vec4 color) {
|
color->on_color_changed = [this](Node* target, glm::vec4 color) {
|
||||||
// ui::Canvas::I->m_current_brush.m_tip_color = color;
|
ui::Canvas::I->m_current_brush.m_tip_color = color;
|
||||||
// // stroke->m_canvas->draw_stroke();
|
};
|
||||||
// };
|
|
||||||
//
|
//
|
||||||
// stroke->on_stroke_change = [this](Node*target) {
|
// stroke->on_stroke_change = [this](Node*target) {
|
||||||
// if (canvas)
|
// if (canvas)
|
||||||
|
|||||||
Reference in New Issue
Block a user