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

Add a simple spray fill tool

Could do with some more tweaking no doubt, and it'd be nice to have a
circular spray, but this is better than nothing.
This commit is contained in:
Robin Burchell 2019-06-16 11:33:20 +02:00 committed by Andreas Kling
parent 940eb1bbeb
commit 502c54e39a
11 changed files with 143 additions and 32 deletions

View file

@ -1,7 +1,7 @@
#pragma once
#include "PaintableWidget.h"
class GMouseEvent;
class PaintableWidget;
class Tool {
public:
@ -9,10 +9,14 @@ public:
virtual const char* class_name() const = 0;
virtual void on_mousedown(PaintableWidget&, GMouseEvent&) { }
virtual void on_mousemove(PaintableWidget&, GMouseEvent&) { }
virtual void on_mouseup(PaintableWidget&, GMouseEvent&) { }
virtual void on_mousedown(GMouseEvent&) { }
virtual void on_mousemove(GMouseEvent&) { }
virtual void on_mouseup(GMouseEvent&) { }
void clear() { m_widget = nullptr; }
void setup(PaintableWidget& widget) { m_widget = widget.make_weak_ptr(); }
protected:
Tool();
WeakPtr<PaintableWidget> m_widget;
};