diff options
| author | DH4 | 2017-06-01 08:11:53 -0500 |
|---|---|---|
| committer | GitHub | 2017-06-01 08:11:53 -0500 |
| commit | 6620f48bfdfd998ce680a75967ca586297fa2530 (patch) | |
| tree | 368fb001490139b85508a1951694217a8add2194 /components | |
| parent | 1eeb763dc31343762f827f9610eb464cce4fd7cc (diff) | |
| parent | 2afdba04fded945f0b47f989e228a8eedd3d50d2 (diff) | |
Merge pull request #5 from IamDH4/tassaron-render-test
minor fixes, comments
Diffstat (limited to 'components')
| -rw-r--r-- | components/text.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/components/text.py b/components/text.py index c9359f2..c0bb61f 100644 --- a/components/text.py +++ b/components/text.py @@ -95,19 +95,16 @@ class Component(__base__.Component): im = Image.new("RGBA", (width, height),(0,0,0,0)) image = ImageQt(im) - image1 = QtGui.QImage(image) - painter = QPainter(image1) + painter = QPainter(image) self.titleFont.setPixelSize(self.fontSize) painter.setFont(self.titleFont) painter.setPen(QColor(*self.textColor)) - - fm = QtGui.QFontMetrics(self.titleFont) painter.drawText(self.xPosition, self.yPosition, self.title) painter.end() buffer = QtCore.QBuffer() buffer.open(QtCore.QIODevice.ReadWrite) - image1.save(buffer, "PNG") + image.save(buffer, "PNG") strio = io.BytesIO() strio.write(buffer.data()) |
