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

PixelPaint: Expose more complex selection operations

Now that we use RectMask internally to store the selection, we can
expose more powerful APIs to allow for better control over the image
selection.
This commit is contained in:
Davipb 2021-06-20 10:53:41 -03:00 committed by Andreas Kling
parent d922e35579
commit 22585e2845
4 changed files with 38 additions and 3 deletions

View file

@ -60,7 +60,7 @@ void RectangleSelectTool::on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&
m_editor->update();
auto rect_in_image = Gfx::IntRect::from_two_points(m_selection_start, m_selection_end);
m_editor->selection().set(rect_in_image);
m_editor->selection().merge(rect_in_image, Selection::MergeMode::Set);
}
void RectangleSelectTool::on_keydown(GUI::KeyEvent& key_event)