summaryrefslogtreecommitdiff
path: root/src/renderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer.cpp')
-rw-r--r--src/renderer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp
index 4337bbf..5285c63 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -381,8 +381,12 @@ Renderer::GetNiceTicks(double v_min, double v_max, const std::string& v_unit, un
fval = std::floor(fval) + 1.0f;
}
fval *= factor;
- assert(v_min <= fval);
- assert(fval <= v_max);
+
+ if ((fval < v_min) || (fval > v_max)) {
+ /* there is no nice value here; usually this happens because the
+ * axis length is too small */
+ return v_min;
+ }
return fval;
};