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
This commit is contained in:
parent
e1415cb3a8
commit
329423f525
@ -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))
|
||||
|
||||
|
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user