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
Notes: sideshowbarker 2024-07-19 04:34:20 +09:00

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;