summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: