diff options
| author | Maximilian Siess | 2017-04-20 18:47:14 +0200 |
|---|---|---|
| committer | Maximilian Siess | 2017-04-20 18:47:14 +0200 |
| commit | f639760ffc8f3152b46c32a881303a7522b8daca (patch) | |
| tree | 2e396fb5243f894c3f7bc4bde89a879deba9c1c3 /core.py | |
| parent | 153ba9123196c0457d8773d4b2a1a5f86ea4c2ab (diff) | |
added x/y offset of text in preview
Diffstat (limited to 'core.py')
| -rw-r--r-- | core.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -26,7 +26,7 @@ class Core(): except: return "avconv" - def drawBaseImage(self, backgroundImage, titleText, titleFont, alignment): + def drawBaseImage(self, backgroundImage, titleText, titleFont, alignment, xOffset, yOffset): if self._image == None or not self.lastBackgroundImage == backgroundImage: self.lastBackgroundImage = backgroundImage @@ -49,13 +49,16 @@ class Core(): painter.setFont(font) painter.setPen(QColor(255, 255, 255)) + yPosition = 375 + yOffset + fm = QtGui.QFontMetrics(font) if alignment == "Left": - painter.drawText(70, 375, titleText) + xPosition = 70 + xOffset if alignment == "Middle": - painter.drawText(1280/2 - fm.width(titleText)/2, 375, titleText) + xPosition = xOffset + (1280/2 - fm.width(titleText)/2) if alignment == "Right": - painter.drawText(1210 - fm.width(titleText), 375, titleText) + xPosition = xOffset + (1210 - fm.width(titleText)) + painter.drawText(xPosition, yPosition, titleText) painter.end() buffer = QtCore.QBuffer() |
