From df0e43940b3315c390d5db83fb90c61456d6619b Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Wed, 15 May 2019 23:38:27 +0100 Subject: [PATCH] Load points as float values --- labelme/app.py | 2 +- labelme/widgets/canvas.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/labelme/app.py b/labelme/app.py index 29b7c96f3..b42e233af 100644 --- a/labelme/app.py +++ b/labelme/app.py @@ -942,7 +942,7 @@ def loadLabels(self, shapes): 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: diff --git a/labelme/widgets/canvas.py b/labelme/widgets/canvas.py index 68c748c19..ac5ebf839 100644 --- a/labelme/widgets/canvas.py +++ b/labelme/widgets/canvas.py @@ -148,7 +148,7 @@ def mouseMoveEvent(self, ev): """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: