mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:47:44 +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:
parent
940eb1bbeb
commit
502c54e39a
11 changed files with 143 additions and 32 deletions
22
Applications/PaintBrush/SprayTool.h
Normal file
22
Applications/PaintBrush/SprayTool.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include "Tool.h"
|
||||
#include <LibGUI/GPainter.h>
|
||||
#include <LibCore/CTimer.h>
|
||||
|
||||
class SprayTool final : public Tool {
|
||||
public:
|
||||
SprayTool();
|
||||
virtual ~SprayTool() override;
|
||||
|
||||
virtual void on_mousedown(GMouseEvent&) override;
|
||||
virtual void on_mouseup(GMouseEvent&) override;
|
||||
virtual void on_mousemove(GMouseEvent&) override;
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "SprayTool"; }
|
||||
void paint_it();
|
||||
CTimer m_timer;
|
||||
Point m_last_pos;
|
||||
Color m_color;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue