summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2014-04-05 17:35:38 +0200
committeranbr <vdr07@deltab.de>2014-04-05 17:35:38 +0200
commitf110173bb35f84b8b6bca4dfd84b910b7deac1ef (patch)
tree012d9f8e98c8825e19a5546ca2401235d07ee482
parentba862b788f6c13e22147a23cd34ea78fb3d30c1a (diff)
downloadvdr-plugin-targavfd-f110173bb35f84b8b6bca4dfd84b910b7deac1ef.tar.gz
vdr-plugin-targavfd-f110173bb35f84b8b6bca4dfd84b910b7deac1ef.tar.bz2
Multiple pages - center short text
-rw-r--r--watch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/watch.c b/watch.c
index 24d7bbf..e103284 100644
--- a/watch.c
+++ b/watch.c
@@ -539,7 +539,11 @@ bool cVFDWatch::RenderText(bool bForce, bool bReDraw, cString* scText) {
if(scText) {
int iRet = -1;
int nTop = (theSetup.m_cHeight - pFont->Height())/2;
- iRet = this->DrawText(0 - m_nScrollOffset,nTop<0?0:nTop, *scText);
+ int nAlign = (this->Width() - pFont->Width(*scText)) / 2;
+ if(nAlign < 0) {
+ nAlign = 0;
+ }
+ iRet = this->DrawText(nAlign - m_nScrollOffset,nTop<0?0:nTop, *scText);
if(m_bScrollNeeded) {
switch(iRet) {
case 0: