add flood fill mode with custom cursor
This commit is contained in:
@@ -388,6 +388,7 @@ void select_button(Node* main, T* button) {
|
||||
//main->find<NodeButton>("btn-fill")->set_color(color_button_normal);
|
||||
main->find<NodeButtonCustom>("btn-mask-free")->set_active(false);
|
||||
main->find<NodeButtonCustom>("btn-mask-line")->set_active(false);
|
||||
main->find<NodeButtonCustom>("btn-bucket")->set_active(false);
|
||||
button->set_active(false);
|
||||
};
|
||||
|
||||
@@ -466,6 +467,7 @@ void App::init_toolbar_draw()
|
||||
}
|
||||
if (auto* button = layout[main_id]->find<NodeButton>("btn-fill"))
|
||||
{
|
||||
// polygon fill
|
||||
button->on_click = [this, button](Node*) {
|
||||
select_button(layout[main_id], button);
|
||||
Canvas::set_mode(kCanvasMode::Fill);
|
||||
@@ -487,8 +489,9 @@ void App::init_toolbar_draw()
|
||||
}
|
||||
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-bucket"))
|
||||
{
|
||||
button->on_click = [this](Node*) {
|
||||
canvas->m_canvas->clear(Canvas::I->m_current_brush->m_tip_color);
|
||||
button->on_click = [this, button](Node*) {
|
||||
select_button(layout[main_id], button);
|
||||
Canvas::set_mode(kCanvasMode::FloodFill);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user