From 329423f525808be59cba4dbb4ed12272e5e5d54b Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Fri, 23 Apr 2021 11:22:46 -0700 Subject: [PATCH] Use QTransform.rotateRadians when appropriate In a few places in the library, we are doing the conversion from radians to degrees just so we can call QTransform.rotate(), but there is a QTransform.rotateRadians() method which would be more suitable, thus making it so we do not have to handle the conversions ourselves --- pyqtgraph/graphicsItems/ROI.py | 2 +- pyqtgraph/graphicsItems/TargetItem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py index 7121947d..08ff0480 100644 --- a/pyqtgraph/graphicsItems/ROI.py +++ b/pyqtgraph/graphicsItems/ROI.py @@ -1524,7 +1524,7 @@ class Handle(UIGraphicsItem): devPos = dt.map(QtCore.QPointF(0,0)) tr = QtGui.QTransform() tr.translate(devPos.x(), devPos.y()) - tr.rotate(degrees(va)) + tr.rotateRadians(va) return dti.map(tr.map(self.path)) diff --git a/pyqtgraph/graphicsItems/TargetItem.py b/pyqtgraph/graphicsItems/TargetItem.py index 67f5920d..40fcdfc0 100644 --- a/pyqtgraph/graphicsItems/TargetItem.py +++ b/pyqtgraph/graphicsItems/TargetItem.py @@ -243,7 +243,7 @@ class TargetItem(UIGraphicsItem): tr = QtGui.QTransform() tr.translate(devPos.x(), devPos.y()) va = atan2(v.y(), v.x()) - tr.rotate(degrees(va)) + tr.rotateRadians(va) tr.scale(self.scale, self.scale) return dti.map(tr.map(self._path))