1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:07:36 +00:00

PaintBrush: Implement a thickness setting for the pen tool.

Painter gains the ability to draw lines with arbitrary thickness.
It's basically implemented by drawing filled rects for thickness>1.

In PaintBrush, Tool classes can now override on_contextmenu() to
provide a context menu for the toolbox button. :^)
This commit is contained in:
Andreas Kling 2019-06-23 10:00:02 +02:00
parent 08c04f0a41
commit 5aefd7f828
6 changed files with 57 additions and 21 deletions

View file

@ -12,6 +12,7 @@ public:
virtual void on_mousedown(GMouseEvent&) { }
virtual void on_mousemove(GMouseEvent&) { }
virtual void on_mouseup(GMouseEvent&) { }
virtual void on_contextmenu(GContextMenuEvent&) { }
void clear() { m_widget = nullptr; }
void setup(PaintableWidget& widget) { m_widget = widget.make_weak_ptr(); }