minor code improvement

This commit is contained in:
ehouse 2006-05-11 03:02:11 +00:00
parent 469a23a183
commit 543df9f681

View file

@ -591,19 +591,18 @@ gtkDrawDrawRemText( DrawCtx* p_dctx, const XP_Rect* r, XP_U16 nTilesLeft,
XP_U16 left = r->left; XP_U16 left = r->left;
XP_U16 top = r->top; XP_U16 top = r->top;
XP_Bool draw = !widthP; XP_Bool draw = !widthP;
PangoLayout* layout = dctx->layout[LAYOUT_SMALL];
sprintf( buf, "rem:%d", nTilesLeft ); sprintf( buf, "rem:%d", nTilesLeft );
pango_layout_set_text( layout, buf, strlen(buf) );
pango_layout_set_text( dctx->layout[LAYOUT_SMALL], buf, strlen(buf) );
if ( draw ) { if ( draw ) {
gdk_draw_layout_with_colors( DRAW_WHAT(dctx), dctx->drawGC, gdk_draw_layout_with_colors( DRAW_WHAT(dctx), dctx->drawGC,
left, top, dctx->layout[LAYOUT_SMALL], left, top, layout,
&dctx->black, NULL ); &dctx->black, NULL );
} else { } else {
int width, height; int width, height;
pango_layout_get_pixel_size( dctx->layout[LAYOUT_SMALL], pango_layout_get_pixel_size( layout, &width, &height );
&width, &height );
if ( height > HOR_SCORE_HEIGHT ) { if ( height > HOR_SCORE_HEIGHT ) {
height = HOR_SCORE_HEIGHT; height = HOR_SCORE_HEIGHT;