mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-04 20:01:53 +02:00
Fix floating point numbers.
This commit is contained in:
parent
6e20668e24
commit
ed0e0384b7
23 changed files with 358 additions and 332 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue