1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:48:13 +00:00

PixelPaint: Make Layer passed to tools a pointer

Some tools (e.g. ZoomTool) doesn't need layer to work. This commit
makes mouse events fire even if there is no layer. This fixes
a bug that ZoomTool didn't work when there is no layers.
This commit is contained in:
Maciej Zygmanowski 2021-08-25 10:07:24 +02:00 committed by Andreas Kling
parent 0224dc2882
commit 3ad9df1522
28 changed files with 202 additions and 136 deletions

View file

@ -19,12 +19,12 @@ public:
RectangleSelectTool();
virtual ~RectangleSelectTool();
virtual void on_mousedown(Layer&, MouseEvent& event) override;
virtual void on_mousemove(Layer&, MouseEvent& event) override;
virtual void on_mouseup(Layer&, MouseEvent& event) override;
virtual void on_mousedown(Layer*, MouseEvent& event) override;
virtual void on_mousemove(Layer*, MouseEvent& event) override;
virtual void on_mouseup(Layer*, MouseEvent& event) override;
virtual void on_keydown(GUI::KeyEvent&) override;
virtual void on_keyup(GUI::KeyEvent&) override;
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
virtual void on_second_paint(Layer const*, GUI::PaintEvent&) override;
virtual GUI::Widget* get_properties_widget() override;
virtual Gfx::StandardCursor cursor() override { return Gfx::StandardCursor::Crosshair; }