Explorar o código

Fix outOfPixmap to solve crashing when outside of the pixmap

Kentaro Wada %!s(int64=5) %!d(string=hai) anos
pai
achega
68a800e15b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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