summaryrefslogtreecommitdiff
path: root/app/wlib/mswlib/mswdraw.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:55:58 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:55:58 +0100
commitd1a8285f818eb7e5c3d6a05709ea21a808490b8c (patch)
tree326578f0505cbed07cfe60de530022822dc237ac /app/wlib/mswlib/mswdraw.c
parent16e9630b79f0a7a90c6cedb6781175bb8b337dc1 (diff)
New upstream version 5.1.0upstream/5.1.0
Diffstat (limited to 'app/wlib/mswlib/mswdraw.c')
-rw-r--r--app/wlib/mswlib/mswdraw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/wlib/mswlib/mswdraw.c b/app/wlib/mswlib/mswdraw.c
index 498b49e..652dde3 100644
--- a/app/wlib/mswlib/mswdraw.c
+++ b/app/wlib/mswlib/mswdraw.c
@@ -698,6 +698,8 @@ void wDrawGetTextSize(
HFONT newFont, prevFont;
DWORD extent;
int oldLfHeight;
+ TEXTMETRIC textMetric;
+
if (fp == NULL)
fp = &logFont;
fp->lfEscapement = 0;
@@ -707,11 +709,15 @@ void wDrawGetTextSize(
newFont = CreateFontIndirect( fp );
prevFont = SelectObject( bd->hDc, newFont );
extent = GetTextExtent( bd->hDc, CAST_AWAY_CONST text, strlen(text) );
+
+ GetTextMetrics(bd->hDc, &textMetric);
+
x = LOWORD(extent);
y = HIWORD(extent);
*w = XPIXELSTOINCH( bd, x );
*h = YPIXELSTOINCH( bd, y );
- *d = 0;
+ *d = YPIXELSTOINCH(bd, textMetric.tmDescent );
+
SelectObject( bd->hDc, prevFont );
DeleteObject( newFont );
fp->lfHeight = oldLfHeight;