Guard against stepsize < 0 in tickMarkGenerator

This commit is contained in:
Jacob Støren
2018-03-06 14:59:38 +01:00
parent 3c26640f56
commit b13422d28b

View File

@@ -47,6 +47,8 @@ class TickMarkGenerator
public: public:
TickMarkGenerator(double min, double max, double minAllowedStepSize) TickMarkGenerator(double min, double max, double minAllowedStepSize)
{ {
if (minAllowedStepSize < 0.0) minAllowedStepSize = -minAllowedStepSize;
double step = roundUpToLog_1_2_5_10(minAllowedStepSize); double step = roundUpToLog_1_2_5_10(minAllowedStepSize);
double startStepCount = ceil(min / step); double startStepCount = ceil(min / step);