mirror of
https://github.com/RGBCube/serenity
synced 2025-09-16 07:06:18 +00:00
Eyes: Allow constructing an eye-grid
Because a line of eyes is just not impressive enough. This does not change any of the default behaviours except breaking the line of eyes at 13 eyes (the 'sweet spot' for the default resolution)
This commit is contained in:
parent
9ee1edae2a
commit
2c6a983b34
3 changed files with 50 additions and 12 deletions
|
@ -37,17 +37,23 @@ public:
|
|||
void track_cursor_globally();
|
||||
|
||||
private:
|
||||
EyesWidget(int num_eyes)
|
||||
: m_num_eyes(num_eyes)
|
||||
EyesWidget(int num_eyes, int full_rows, int extra)
|
||||
: m_full_rows(full_rows)
|
||||
, m_extra_columns(extra)
|
||||
{
|
||||
m_num_rows = m_extra_columns > 0 ? m_full_rows + 1 : m_full_rows;
|
||||
m_eyes_in_row = (num_eyes - extra) / full_rows;
|
||||
}
|
||||
|
||||
virtual void mousemove_event(GUI::MouseEvent&) override;
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
||||
void render_eyeball(int index, GUI::Painter&) const;
|
||||
void render_eyeball(int row, int column, GUI::Painter&) const;
|
||||
Gfx::IntPoint pupil_center(Gfx::IntRect& eyeball_bounds) const;
|
||||
|
||||
Gfx::IntPoint m_mouse_position;
|
||||
int m_num_eyes { -1 };
|
||||
int m_eyes_in_row { -1 };
|
||||
int m_full_rows { -1 };
|
||||
int m_extra_columns { -1 };
|
||||
int m_num_rows { -1 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue