Explorar o código

Load points as float values

Kentaro Wada %!s(int64=6) %!d(string=hai) anos
pai
achega
df0e43940b
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      labelme/app.py
  2. 1 1
      labelme/widgets/canvas.py

+ 1 - 1
labelme/app.py

@@ -942,7 +942,7 @@ class MainWindow(QtWidgets.QMainWindow):
         for label, points, line_color, fill_color, shape_type, flags in shapes:
             shape = Shape(label=label, shape_type=shape_type)
             for x, y in points:
-                shape.addPoint(QtCore.QPoint(x, y))
+                shape.addPoint(QtCore.QPointF(x, y))
             shape.close()
 
             if line_color:

+ 1 - 1
labelme/widgets/canvas.py

@@ -148,7 +148,7 @@ class Canvas(QtWidgets.QWidget):
         """Update line with last point and current coordinates."""
         try:
             if QT5:
-                pos = self.transformPos(ev.pos())
+                pos = self.transformPos(ev.localPos())
             else:
                 pos = self.transformPos(ev.posF())
         except AttributeError: