summaryrefslogtreecommitdiff
path: root/Demos
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-07-27 15:25:29 +0430
committerAndreas Kling <kling@serenityos.org>2020-07-27 12:57:27 +0200
commitf8becd4df86eae4895f580b76921032586ff675a (patch)
treefce47b4ff5708eefee3773b2e5ead211b8f1a443 /Demos
parent2c6a983b34b022153f3b8af2b811e616647679bf (diff)
downloadserenity-f8becd4df86eae4895f580b76921032586ff675a.zip
Eyes: Fix division by zero when invoked as 'Eyes'
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Eyes/EyesWidget.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Demos/Eyes/EyesWidget.h b/Demos/Eyes/EyesWidget.h
index c03f87b291..fb01e27a45 100644
--- a/Demos/Eyes/EyesWidget.h
+++ b/Demos/Eyes/EyesWidget.h
@@ -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;