From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/wlib/mswlib/mswmsg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'app/wlib/mswlib/mswmsg.c') diff --git a/app/wlib/mswlib/mswmsg.c b/app/wlib/mswlib/mswmsg.c index 4a21921..6445299 100644 --- a/app/wlib/mswlib/mswmsg.c +++ b/app/wlib/mswlib/mswmsg.c @@ -42,6 +42,7 @@ static void repaintMessage( HFONT hFont; LOGFONT msgFont; double scale = 1.0; + TEXTMETRIC textMetrics; hDc = GetDC( hWnd ); @@ -74,13 +75,15 @@ static void repaintMessage( hFont = SelectObject( hDc, mswLabelFont ); } + GetTextMetrics(hDc, &textMetrics); + rect.bottom = (long)(bm->y+( bm->h )); rect.right = (long)(bm->x+( scale * bm->w )); - rect.top = bm->y; + rect.top = bm->y+1; rect.left = bm->x; SetBkColor( hDc, GetSysColor( COLOR_BTNFACE ) ); - ExtTextOut( hDc, bm->x, bm->y, ETO_CLIPPED|ETO_OPAQUE, &rect, bm->message, strlen( bm->message ), NULL ); + ExtTextOut( hDc, bm->x, bm->y + ((bm->h + 2 - textMetrics.tmHeight) / 2), ETO_CLIPPED|ETO_OPAQUE, &rect, bm->message, strlen( bm->message ), NULL ); if( scale != 1.0 ) /* in case we did create a new font earlier, delete it now */ @@ -138,7 +141,7 @@ wPos_t wMessageGetHeight( long flags ) if( flags & BM_SMALL ) scale = SCALE_SMALL; - return((wPos_t)((mswEditHeight - 4) * scale )); + return((wPos_t)((mswEditHeight) * scale )); #endif } -- cgit v1.2.3