Răsfoiți Sursa

Fix outOfPixmap to solve crashing when outside of the pixmap

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

+ 1 - 1
labelme/widgets/canvas.py

@@ -532,7 +532,7 @@ class Canvas(QtWidgets.QWidget):
 
     def outOfPixmap(self, p):
         w, h = self.pixmap.width(), self.pixmap.height()
-        return not (0 <= p.x() < w and 0 <= p.y() < h)
+        return not (0 <= p.x() <= w - 1 and 0 <= p.y() <= h - 1)
 
     def finalise(self):
         assert self.current