1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

PixelPaint: Add fill mode for the ellipse tool

Functionality was already there, just had to hook it up!
This commit is contained in:
Valtteri Koskivuori 2021-05-01 22:02:31 +03:00 committed by Linus Groh
parent 8293b22361
commit 4e6f03a860
2 changed files with 7 additions and 1 deletions

View file

@ -29,6 +29,9 @@ void EllipseTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& ellipse_
case Mode::Outline:
painter.draw_ellipse_intersecting(ellipse_intersecting_rect, m_editor->color_for(m_drawing_button), m_thickness);
break;
case Mode::Fill:
painter.fill_ellipse(ellipse_intersecting_rect, m_editor->color_for(m_drawing_button));
break;
default:
VERIFY_NOT_REACHED();
}
@ -96,6 +99,9 @@ void EllipseTool::on_tool_button_contextmenu(GUI::ContextMenuEvent& event)
m_context_menu->add_action(GUI::Action::create("Outline", [this](auto&) {
m_mode = Mode::Outline;
}));
m_context_menu->add_action(GUI::Action::create("Fill", [this](auto&) {
m_mode = Mode::Fill;
}));
m_context_menu->add_separator();
m_thickness_actions.set_exclusive(true);
auto insert_action = [&](int size, bool checked = false) {