summaryrefslogtreecommitdiff
path: root/src/editorui/paths.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/editorui/paths.py')
-rw-r--r--src/editorui/paths.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/editorui/paths.py b/src/editorui/paths.py
index ad81fa0..8b45ea9 100644
--- a/src/editorui/paths.py
+++ b/src/editorui/paths.py
@@ -307,34 +307,38 @@ class KPEditorPath(QtGui.QGraphicsLineItem):
def paintEvent(self, event):
-
painter = QtGui.QPainter(self)
+ contentsRect = self.contentsRect()
if self.path > 0:
painter.save()
+ displaceX, displaceY = contentsRect.width() / 2, contentsRect.height() / 2
+
pathItem = self._pathRef().qtItem.line()
if self.path == 1:
- angle = pathItem.angle()
+ angle = 90 - pathItem.angle()
else:
- angle = 180 + pathItem.angle()
+ angle = 270 - pathItem.angle()
+ painter.translate(displaceX, displaceY)
painter.rotate(angle)
- self.arrowIcon.paint(painter, self.contentsRect(), Qt.AlignCenter)
+ painter.translate(-displaceX, -displaceY)
+ self.arrowIcon.paint(painter, contentsRect, Qt.AlignCenter)
painter.restore()
if self.isDown():
- self.iconList[self.secret].paint(painter, self.contentsRect(), Qt.AlignCenter, QtGui.QIcon.Disabled)
+ self.iconList[self.secret].paint(painter, contentsRect, Qt.AlignCenter, QtGui.QIcon.Disabled)
else:
- self.iconList[self.secret].paint(painter, self.contentsRect(), Qt.AlignCenter)
+ self.iconList[self.secret].paint(painter, contentsRect, Qt.AlignCenter)
else:
if self.isDown():
- self.unlockIcon.paint(painter, self.contentsRect(), Qt.AlignCenter, QtGui.QIcon.Disabled)
+ self.unlockIcon.paint(painter, contentsRect, Qt.AlignCenter, QtGui.QIcon.Disabled)
else:
- self.unlockIcon.paint(painter, self.contentsRect(), Qt.AlignCenter)
+ self.unlockIcon.paint(painter, contentsRect, Qt.AlignCenter)
painter.end()