Parcourir la source

Fix computation of cap_max

Baptiste Jonglez il y a 9 ans
Parent
commit
08648f938c
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      panorama/models.py

+ 3 - 1
panorama/models.py

@@ -263,8 +263,10 @@ class Panorama(ReferencePoint):
         target_x = 0 if ismin else self.image_width
         target_x = 0 if ismin else self.image_width
 
 
         # For circulary issues
         # For circulary issues
-        if cap2 < cap1:
+        if ismin and cap2 < cap1:
             cap2 += 360
             cap2 += 360
+        if (not ismin) and cap1 < cap2:
+            cap1 += 360
 
 
         target_cap =  cap1 + (target_x - ref1.x) * (cap2 - cap1) / \
         target_cap =  cap1 + (target_x - ref1.x) * (cap2 - cap1) / \
                 (ref2.x - ref1.x)
                 (ref2.x - ref1.x)