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

HackStudio: Move the rubber-banding state into CursorTool

I originally put it in FormWidget because CursorTool was clueless about
painting. This patch adds Tool::on_second_paint() which allows all the
tools to hook into the second paint pass.
This commit is contained in:
Andreas Kling 2019-11-16 22:26:46 +01:00
parent 5fc62bcf68
commit 197ed1bb2a
5 changed files with 68 additions and 77 deletions

View file

@ -20,8 +20,16 @@ private:
virtual void on_mouseup(GMouseEvent&) override;
virtual void on_mousemove(GMouseEvent&) override;
virtual void on_keydown(GKeyEvent&) override;
virtual void on_second_paint(GPainter&, GPaintEvent&) override;
void set_rubber_band_position(const Point&);
Rect rubber_band_rect() const;
Point m_drag_origin;
HashMap<GWidget*, Point> m_positions_before_drag;
bool m_dragging { false };
bool m_rubber_banding { false };
Point m_rubber_band_origin;
Point m_rubber_band_position;
};