mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:18:12 +00:00

This patch moves the marching ants painting code to Selection and unifies the timer mechanism so that all marching ants are synchronized which looks neat. :^)
29 lines
734 B
C++
29 lines
734 B
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Tool.h"
|
|
|
|
namespace PixelPaint {
|
|
|
|
class RectangleSelectTool final : public Tool {
|
|
public:
|
|
RectangleSelectTool();
|
|
virtual ~RectangleSelectTool();
|
|
|
|
virtual void on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
|
virtual void on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
|
virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
|
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
|
|
|
|
private:
|
|
bool m_selecting { false };
|
|
Gfx::IntPoint m_selection_start;
|
|
Gfx::IntPoint m_selection_end;
|
|
};
|
|
|
|
}
|