From 044a889d6d4caecbc0551ab1c1699abf7b9b8b84 Mon Sep 17 00:00:00 2001 From: ehouse Date: Sun, 25 Nov 2007 15:12:22 +0000 Subject: [PATCH] Don't draw negative number of tiles left. --- linux/gtkdraw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/gtkdraw.c b/linux/gtkdraw.c index a2bfe24e0..e6096d3c6 100644 --- a/linux/gtkdraw.c +++ b/linux/gtkdraw.c @@ -707,7 +707,7 @@ gtk_draw_scoreBegin( DrawCtx* p_dctx, const XP_Rect* rect, } /* gtk_draw_scoreBegin */ static void -gtkDrawDrawRemText( DrawCtx* p_dctx, const XP_Rect* r, XP_U16 nTilesLeft, +gtkDrawDrawRemText( DrawCtx* p_dctx, const XP_Rect* r, XP_S16 nTilesLeft, XP_U16* widthP, XP_U16* heightP ) { GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; @@ -764,7 +764,7 @@ scoreWidthAndText( GtkDrawCtx* XP_UNUSED(dctx), PangoLayout* layout, char* buf, } sprintf( buf, "%s%.3d", borders, score ); - if ( nTilesLeft < MAX_TRAY_TILES ) { + if ( (nTilesLeft < MAX_TRAY_TILES) && (nTilesLeft > 0) ) { char nbuf[10]; sprintf( nbuf, ":%d", nTilesLeft ); (void)strcat( buf, nbuf ); @@ -794,7 +794,7 @@ gtk_draw_measureScoreText( DrawCtx* p_dctx, const XP_Rect* r, { GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; char buf[20]; - PangoLayout* layout = layout_for_ht( dctx, r->height ); + PangoLayout* layout = layout_for_ht( dctx, r->height-2 ); scoreWidthAndText( dctx, layout, buf, dsi, width, height ); } /* gtk_draw_measureScoreText */