summaryrefslogtreecommitdiff
path: root/app/wlib/mswlib/mswmsg.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-22 14:05:41 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-22 14:05:41 +0200
commitb55285a77da0e0b829e4ce8d7e09debaabc68e15 (patch)
treef622559ef65bbdd3e1c5bdb06098a8f89eec0563 /app/wlib/mswlib/mswmsg.c
parentd3897ce090dbeb220ed2c782f095597e417cf3cc (diff)
parentd1ae75703e1ed81d65ea16946dcdb77e7a13adc9 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'app/wlib/mswlib/mswmsg.c')
-rw-r--r--app/wlib/mswlib/mswmsg.c9
1 files changed, 6 insertions, 3 deletions
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
}