Commit 6b5e045b authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/tools.js: when min == max, keep one step

parent 40dbbbaa
...@@ -370,7 +370,11 @@ function nice_floor(x, force_pow10) ...@@ -370,7 +370,11 @@ function nice_floor(x, force_pow10)
function nice_min_max_steps(min, max, nb_max_steps) function nice_min_max_steps(min, max, nb_max_steps)
{ {
if (min == max) if (min == max)
return {min: min, max: max, step: 0, nb_steps: 0} {
min = nice_floor(min)
max = nice_ceil(max + 1)
nb_max_steps = 1
}
var basic_step = nice_1_2_5_ceil((max - min) / nb_max_steps) var basic_step = nice_1_2_5_ceil((max - min) / nb_max_steps)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment