aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDH42017-05-27 04:49:26 -0500
committerDH42017-05-27 04:49:26 -0500
commit1a8acdbed09cc751d587e99bfc848c29752104e5 (patch)
tree023209551bd4e6f2ceead2a986c341f7d3284d32
parentf2329e93660780fc261abdbbd9d43884fdcaf722 (diff)
Fixed Scaling Bugs
-rw-r--r--core.py19
-rw-r--r--main.py3
2 files changed, 11 insertions, 11 deletions
diff --git a/core.py b/core.py
index d360ca6..249a373 100644
--- a/core.py
+++ b/core.py
@@ -65,9 +65,9 @@ class Core():
painter.setFont(font)
painter.setPen(QColor(*textColor))
- yPosition = yOffset
-
fm = QtGui.QFontMetrics(font)
+ yPosition = yOffset + fm.height()/6
+
if alignment == 0: #Left
xPosition = xOffset
if alignment == 1: #Middle
@@ -92,21 +92,20 @@ class Core():
width = int(self.settings.value('outputWidth'))
height = int(int(self.settings.value('outputHeight'))/2)
- imTop = Image.new("RGBA", (width, height))
- draw = ImageDraw.Draw(imTop)
- r, g, b = color
- color2 = (r, g, b, 50)
-
vH = height-height/8
bF = int(self.settings.value('outputWidth')) / 64
bH = bF / 2
bQ = bF / 4
+ imTop = Image.new("RGBA", (width, height))
+ draw = ImageDraw.Draw(imTop)
+ r, g, b = color
+ color2 = (r, g, b, 50)
bP = int(self.settings.value('outputHeight')) / 800
for j in range(0, 63):
- draw.rectangle((bH + j * bF, vH, bH + j * bF + bF, vH + bQ - spectrum[j * 4] * bP - bH), fill=color2)
- draw.rectangle((bH + bQ + j * bF, vH - bQ , bH + bQ + j * bF + bH, vH - spectrum[j * 4] * bP), fill=color)
+ draw.rectangle((bH + j * bF, vH+bQ, bH + j * bF + bF, vH + bQ - spectrum[j * 4] * bP - bH), fill=color2)
+ draw.rectangle((bH + bQ + j * bF, vH , bH + bQ + j * bF + bH, vH - spectrum[j * 4] * bP), fill=color)
imBottom = imTop.transpose(Image.FLIP_TOP_BOTTOM)
@@ -114,7 +113,7 @@ class Core():
im = Image.new("RGB", (int(self.settings.value('outputWidth')), int(self.settings.value('outputHeight'))), "black")
im.paste(image, (0, 0))
im.paste(imTop, (0, 0), mask=imTop)
- im.paste(imBottom, (0, int(vH+bF*.7)), mask=imBottom)
+ im.paste(imBottom, (0, int(vH+bF*1.8)), mask=imBottom)
return im
diff --git a/main.py b/main.py
index bfa8fbd..a065680 100644
--- a/main.py
+++ b/main.py
@@ -166,9 +166,10 @@ class Main(QtCore.QObject):
window.alignmentComboBox.addItem("Middle")
window.alignmentComboBox.addItem("Right")
window.alignmentComboBox.setCurrentIndex(1)
- window.fontsizeSpinBox.setValue(int(int(self.settings.value("outputHeight")) / 16 ))
+ window.fontsizeSpinBox.setValue(int(int(self.settings.value("outputHeight")) / 14 ))
window.textXSpinBox.setValue(int(int(self.settings.value('outputWidth'))/2))
window.textYSpinBox.setValue(int(int(self.settings.value('outputHeight'))/2))
+
window.lineEdit_textColor.setText('%s,%s,%s' % self.textColor)
window.lineEdit_visColor.setText('%s,%s,%s' % self.visColor)
window.pushButton_textColor.clicked.connect(lambda: self.pickColor('text'))