summaryrefslogtreecommitdiff
path: root/src/editorui
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-11-22 18:42:32 +0100
committerTreeki <treeki@gmail.com>2011-11-22 18:42:32 +0100
commit95e6d049fd23ba1919d8b67d2071d57a422bdc85 (patch)
tree5e7b0af5a9f373b1f75db7885e15b02f225216a1 /src/editorui
parent5a70b9a8d357a44fc245a95b76f8ab17aa03bc6e (diff)
downloadkoopatlas-95e6d049fd23ba1919d8b67d2071d57a422bdc85.tar.gz
koopatlas-95e6d049fd23ba1919d8b67d2071d57a422bdc85.zip
fixed the arrow thing
Diffstat (limited to '')
-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()