Draw tray tile value very small in highres case.

This commit is contained in:
ehouse 2004-10-30 19:25:23 +00:00
parent 03eeac1d30
commit 881e81425c
2 changed files with 40 additions and 21 deletions

View file

@ -450,7 +450,6 @@ palm_draw_drawTile( DrawCtx* p_dctx, XP_Rect* rect,
char valBuf[3];
XP_Rect localR = *rect;
XP_U16 len, width;
WinHandle numberWin = dctx->numberWin;
XP_U16 doubler = 1;
#ifdef FEATURE_HIGHRES
@ -488,12 +487,27 @@ palm_draw_drawTile( DrawCtx* p_dctx, XP_Rect* rect,
}
if ( val >= 0 ) {
RectangleType numRect = {{0,0}, {NUMRECT_WIDTH*2, NUMRECT_HEIGHT*2}};
WinHandle curWind;
(void)StrPrintF( valBuf, "%d", val );
len = XP_STRLEN((const char*)valBuf);
if ( dctx->doHiRes ) {
UInt32 oldMode = WinSetScalingMode( kTextScalingOff );
FontID curFont = FntGetFont();
FntSetFont( boldFont );
width = FntCharsWidth( (const char*)valBuf, len );
WinDrawChars( valBuf, len,
localR.left + localR.width - width,
localR.top + localR.height - dctx->fntHeight - 1 );
FntSetFont( curFont );
WinSetScalingMode( oldMode );
} else {
RectangleType numRect = {{0,0},
{NUMRECT_WIDTH*2, NUMRECT_HEIGHT*2}};
WinHandle curWind;
WinHandle numberWin = dctx->numberWin;
XP_ASSERT( !!numberWin );
curWind = WinSetDrawWindow( numberWin );
HIGHRES_PUSH_LOC( dctx );
@ -521,6 +535,7 @@ palm_draw_drawTile( DrawCtx* p_dctx, XP_Rect* rect,
winOverlay );
#endif
}
}
WinDrawRectangleFrame( rectangleFrame, (RectangleType*)&localR );
if ( highlighted ) {
@ -927,6 +942,7 @@ palm_draw_score_pendingScore( DrawCtx* p_dctx, XP_Rect* rect, XP_S16 score,
}
if ( rect->height >= PALM_TRAY_SCALEH ) {
str = (*dctx->getResStrFunc)( dctx->globals, STR_PTS );
WinDrawChars( (const char*)str,
XP_STRLEN((const char*)str), x, rect->top );
}
@ -1286,6 +1302,8 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able,
XP_MEMCPY( &dctx->u.bnw.valuePatterns[0], patBits, sizeof(patBits) );
}
dctx->fntHeight = FntBaseLine();
return (DrawCtx*)dctx;
} /* palm_drawctxt_make */

View file

@ -70,6 +70,7 @@ typedef struct PalmDrawCtx {
WinHandle numberWin;
XP_S16 trayOwner;
XP_U16 fntHeight;
GraphicsAbility able;