瀏覽代碼

Use QPointF to handle float in Canvas.boundedMoveShapes

Kentaro Wada 2 年之前
父節點
當前提交
d8a13a3980
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      labelme/widgets/canvas.py

+ 2 - 2
labelme/widgets/canvas.py

@@ -556,10 +556,10 @@ class Canvas(QtWidgets.QWidget):
             return False  # No need to move
         o1 = pos + self.offsets[0]
         if self.outOfPixmap(o1):
-            pos -= QtCore.QPoint(min(0, o1.x()), min(0, o1.y()))
+            pos -= QtCore.QPointF(min(0, o1.x()), min(0, o1.y()))
         o2 = pos + self.offsets[1]
         if self.outOfPixmap(o2):
-            pos += QtCore.QPoint(
+            pos += QtCore.QPointF(
                 min(0, self.pixmap.width() - o2.x()),
                 min(0, self.pixmap.height() - o2.y()),
             )