mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +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
|
@ -17,11 +17,6 @@ public:
|
|||
// FIXME: This should be an app-wide preference instead.
|
||||
int grid_size() const { return m_grid_size; }
|
||||
|
||||
bool is_rubber_banding(Badge<CursorTool>) const { return m_rubber_banding; }
|
||||
void set_rubber_banding(Badge<CursorTool>, bool);
|
||||
void set_rubber_band_position(Badge<CursorTool>, const Point&);
|
||||
void set_rubber_band_origin(Badge<CursorTool>, const Point&);
|
||||
|
||||
private:
|
||||
virtual bool accepts_focus() const override { return true; }
|
||||
|
||||
|
@ -34,11 +29,5 @@ private:
|
|||
|
||||
explicit FormWidget(FormEditorWidget& parent);
|
||||
|
||||
Rect rubber_band_rect() const;
|
||||
|
||||
int m_grid_size { 5 };
|
||||
|
||||
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