浏览代码

Fix outOfPixmap to solve crashing when outside of the pixmap

Kentaro Wada 5 年之前
父节点
当前提交
68a800e15b
共有 1 个文件被更改,包括 1 次插入1 次删除
  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