From 3ab25c843b3544d71576c0a764c799fb4abfae02 Mon Sep 17 00:00:00 2001 From: ehouse Date: Thu, 23 Jun 2005 04:21:35 +0000 Subject: [PATCH] fix timer not getting drawn on highres screens --- xwords4/palm/palmdraw.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/xwords4/palm/palmdraw.c b/xwords4/palm/palmdraw.c index f93cc2f8a..7ee0c82c5 100644 --- a/xwords4/palm/palmdraw.c +++ b/xwords4/palm/palmdraw.c @@ -1024,11 +1024,18 @@ static void palm_draw_drawTimer( DrawCtx* p_dctx, XP_Rect* rInner, XP_Rect* rOuter, XP_U16 player, XP_S16 secondsLeft ) { + /* This is called both from within drawScoreboard and not, meaning that + * sometimes draw_boardBegin() and draw_boardFinished() bracket it and + * sometimes they don't. So it has to do its own HIGHRES_PUSH_LOC stuff. + */ + PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx; XP_UCHAR buf[10]; XP_Rect localR = *rInner; RectangleType saveClip; XP_U16 len, width; + HIGHRES_PUSH_LOC(dctx); + palmFormatTimerText( buf, secondsLeft ); len = XP_STRLEN( (const char*)buf ); @@ -1041,13 +1048,19 @@ palm_draw_drawTimer( DrawCtx* p_dctx, XP_Rect* rInner, XP_Rect* rOuter, localR.width = width; } - localR.top -= 2; - localR.height += 1; +#ifdef FEATURE_HIGHRES + if ( !dctx->doHiRes ) { + localR.height += 1; + } +#endif WinGetClip( &saveClip ); WinSetClip( (RectangleType*)&localR ); - WinDrawChars( (const char*)buf, len, localR.left, localR.top ); + + WinDrawChars( (const char*)buf, len, localR.left, localR.top - 2 ); WinSetClip( &saveClip ); + + HIGHRES_POP_LOC(dctx); } /* palm_draw_drawTimer */ #define MINI_LINE_HT 12