Fix floating point numbers.

This commit is contained in:
Sergey Vartanov 2021-11-11 23:52:46 +03:00
parent 6e20668e24
commit ed0e0384b7
23 changed files with 358 additions and 332 deletions

View file

@ -35,7 +35,7 @@ def get_gradient_color(
scale: list[Color] = colors + [Color("black")]
range_coefficient: float = (
0 if bounds.is_empty() else (value - bounds.min_) / bounds.delta()
0.0 if bounds.is_empty() else (value - bounds.min_) / bounds.delta()
)
# If value is out of range, set it to boundary value.
range_coefficient = min(1.0, max(0.0, range_coefficient))