mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57: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:
parent
5fc62bcf68
commit
197ed1bb2a
5 changed files with 68 additions and 77 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue