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

Eyes: Fix division by zero when invoked as 'Eyes'

This commit is contained in:
AnotherTest 2020-07-27 15:25:29 +04:30 committed by Andreas Kling
parent 2c6a983b34
commit f8becd4df8

View file

@ -42,7 +42,7 @@ private:
, 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;
m_eyes_in_row = m_full_rows > 0 ? (num_eyes - m_extra_columns) / m_full_rows : m_extra_columns;
}
virtual void mousemove_event(GUI::MouseEvent&) override;