Răsfoiți Sursa

Clip only x1 and y1 for intersectingEdges

Kentaro Wada 5 ani în urmă
părinte
comite
854f039fd5
1 a modificat fișierele cu 1 adăugiri și 4 ștergeri
  1. 1 4
      labelme/widgets/canvas.py

+ 1 - 4
labelme/widgets/canvas.py

@@ -560,12 +560,9 @@ class Canvas(QtWidgets.QWidget):
                   (size.width() - 1, 0),
                   (size.width() - 1, size.height() - 1),
                   (0, size.height() - 1)]
-        # FIXME: below clipping is unnecessary on Linux and Mac,
-        # but required on Windows to avoid error in intersectingEdges
+        # x1, y1 should be in the pixmap, x2, y2 should be out of the pixmap
         x1 = min(max(p1.x(), 0), size.width() - 1)
-        x2 = min(max(p2.x(), 0), size.width() - 1)
         y1 = min(max(p1.y(), 0), size.height() - 1)
-        y2 = min(max(p2.y(), 0), size.height() - 1)
         d, i, (x, y) = min(self.intersectingEdges((x1, y1), (x2, y2), points))
         x3, y3 = points[i]
         x4, y4 = points[(i + 1) % 4]