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

@ -289,16 +289,16 @@ class RoadMatcher(Matcher):
if "color" in structure:
self.color = Color(scheme.get_color(structure["color"]))
self.default_width: float = structure["default_width"]
self.priority: float = 0
self.priority: float = 0.0
if "priority" in structure:
self.priority = structure["priority"]
def get_priority(self, tags: Tags) -> float:
"""Get priority for drawing order."""
layer: float = 0
layer: float = 0.0
if "layer" in tags:
layer = float(tags.get("layer"))
return 1000 * layer + self.priority
return 1000.0 * layer + self.priority
class Scheme:
@ -598,7 +598,7 @@ class Scheme:
"""
shape: Shape = extractor.get_shape(DEFAULT_SHAPE_ID)
color: Color = color
offset: np.ndarray = np.array((0, 0))
offset: np.ndarray = np.array((0.0, 0.0))
flip_horizontally: bool = False
flip_vertically: bool = False
use_outline: bool = True