aboutsummaryrefslogtreecommitdiff
path: root/src/components/text.py
diff options
context:
space:
mode:
authortassaron2017-07-11 06:06:22 -0400
committertassaron2017-07-11 06:06:22 -0400
commit2e37dafd7036973a315b525f131850a6fb6d0b35 (patch)
tree090e5b29c706f38945209e33161b4cc9713782f2 /src/components/text.py
parent4c3920e6309b4e67e3d8d809dd0b5b6cd245fd0c (diff)
fixed various bugs
Diffstat (limited to 'src/components/text.py')
-rw-r--r--src/components/text.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/text.py b/src/components/text.py
index fb6a90e..ed50064 100644
--- a/src/components/text.py
+++ b/src/components/text.py
@@ -75,15 +75,15 @@ class Component(Component):
'''Returns true x, y after considering alignment settings'''
fm = QtGui.QFontMetrics(self.titleFont)
if self.alignment == 0: # Left
- x = self.xPosition
+ x = int(self.xPosition)
if self.alignment == 1: # Middle
offset = fm.width(self.title)/2
- x = self.xPosition - offset
+ x = int(self.xPosition - offset)
if self.alignment == 2: # Right
offset = fm.width(self.title)
- x = self.xPosition - offset
+ x = int(self.xPosition - offset)
return x, self.yPosition
def loadPreset(self, pr, presetName=None):
@@ -128,12 +128,12 @@ class Component(Component):
return self.addText(width, height)
def addText(self, width, height):
- x, y = self.getXY()
- image = FramePainter(width, height)
+ image = FramePainter(width, height)
self.titleFont.setPixelSize(self.fontSize)
image.setFont(self.titleFont)
image.setPen(self.textColor)
+ x, y = self.getXY()
image.drawText(x, y, self.title)
return image.finalize()