From eb89ef2f2b356b6656c286fd1f990c001515ac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 24 May 2018 23:19:30 +0200 Subject: [PATCH] Refactoring --- src/GUI/axisitem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GUI/axisitem.cpp b/src/GUI/axisitem.cpp index 375e8ffe..a2c487f4 100644 --- a/src/GUI/axisitem.cpp +++ b/src/GUI/axisitem.cpp @@ -14,7 +14,7 @@ class Ticks { public: - Ticks(double min, double max, int count); + Ticks(double minValue, double maxValue, int maxCount); int count() const {return ((int)((_max - _min) / _d)) + 1;} double val(int i) const {return _min + i * _d;} @@ -27,12 +27,12 @@ private: double _d; }; -Ticks::Ticks(double min, double max, int count) +Ticks::Ticks(double minValue, double maxValue, int maxCount) { - double range = niceNum(max - min, 0); - _d = niceNum(range / count, 1); - _min = ceil(min / _d) * _d; - _max = floor(max / _d) * _d; + double range = niceNum(maxValue - minValue, 0); + _d = niceNum(range / maxCount, 1); + _min = ceil(minValue / _d) * _d; + _max = floor(maxValue / _d) * _d; }