diff options
author | anbr <vdr07@deltab.de> | 2014-04-05 17:35:38 +0200 |
---|---|---|
committer | anbr <vdr07@deltab.de> | 2014-04-05 17:35:38 +0200 |
commit | f110173bb35f84b8b6bca4dfd84b910b7deac1ef (patch) | |
tree | 012d9f8e98c8825e19a5546ca2401235d07ee482 | |
parent | ba862b788f6c13e22147a23cd34ea78fb3d30c1a (diff) | |
download | vdr-plugin-targavfd-f110173bb35f84b8b6bca4dfd84b910b7deac1ef.tar.gz vdr-plugin-targavfd-f110173bb35f84b8b6bca4dfd84b910b7deac1ef.tar.bz2 |
Multiple pages - center short text
-rw-r--r-- | watch.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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: |