aboutsummaryrefslogtreecommitdiff
path: root/src/components/text.py
diff options
context:
space:
mode:
authortassaron2017-07-13 00:05:11 -0400
committertassaron2017-07-13 00:05:11 -0400
commit8811b699a9c2d6b78af1e2a332d3031aef73aec4 (patch)
treee62f318fb625c5c79314de2eb0ce4b7b93e7496c /src/components/text.py
parent2e37dafd7036973a315b525f131850a6fb6d0b35 (diff)
merge consecutive static components
Diffstat (limited to 'src/components/text.py')
-rw-r--r--src/components/text.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/components/text.py b/src/components/text.py
index ed50064..4435b80 100644
--- a/src/components/text.py
+++ b/src/components/text.py
@@ -17,10 +17,11 @@ class Component(Component):
self.titleFont = QFont()
def widget(self, parent):
- height = int(parent.settings.value('outputHeight'))
- width = int(parent.settings.value('outputWidth'))
-
self.parent = parent
+ self.settings = self.parent.core.settings
+ height = int(self.settings.value('outputHeight'))
+ width = int(self.settings.value('outputWidth'))
+
self.textColor = (255, 255, 255)
self.title = 'Text'
self.alignment = 1
@@ -78,12 +79,12 @@ class Component(Component):
x = int(self.xPosition)
if self.alignment == 1: # Middle
- offset = fm.width(self.title)/2
- x = int(self.xPosition - offset)
+ offset = int(fm.width(self.title)/2)
+ x = self.xPosition - offset
if self.alignment == 2: # Right
offset = fm.width(self.title)
- x = int(self.xPosition - offset)
+ x = self.xPosition - offset
return x, self.yPosition
def loadPreset(self, pr, presetName=None):
@@ -115,16 +116,16 @@ class Component(Component):
}
def previewRender(self, previewWorker):
- width = int(previewWorker.core.settings.value('outputWidth'))
- height = int(previewWorker.core.settings.value('outputHeight'))
+ width = int(self.settings.value('outputWidth'))
+ height = int(self.settings.value('outputHeight'))
return self.addText(width, height)
def properties(self):
return ['static']
def frameRender(self, layerNo, frameNo):
- width = int(self.worker.core.settings.value('outputWidth'))
- height = int(self.worker.core.settings.value('outputHeight'))
+ width = int(self.settings.value('outputWidth'))
+ height = int(self.settings.value('outputHeight'))
return self.addText(width, height)
def addText(self, width, height):