Parcourir la source

Fix angles computation when user input is incorrect

Baptiste Jonglez il y a 10 ans
Parent
commit
508e84b47c
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      backend.py

+ 2 - 0
backend.py

@@ -240,6 +240,8 @@ def merge_intervals(l, wrap=360):
 
 def orientations_to_angle(orientations):
      """Return a list of (start, stop) angles from a list of orientations."""
+     # Cleanup
+     orientations = [o for o in orientations if o in ANGLES.keys()]
      # Hack to make leaflet-semicircle happy (drawing a full circle only
      # works with (0, 360))
      if len(orientations) == 8: