fix bug in get-text-extent on zero-length string when neither descent or vertical space is requested

svn: r6776
This commit is contained in:
Matthew Flatt 2007-06-29 22:51:07 +00:00
parent f4b1315710
commit b1233fb40c

View File

@ -2214,14 +2214,14 @@ void wxDC::GetTextExtent(const char *string, double *x, double *y,
once = 0;
}
if (descent || topSpace)
if (descent || topSpace || (!len && !ty))
GetTextMetrics(dc, &tm);
DoneDC(dc);
*x = (double)tx;
if (!len && !ty) {
*y = (double)tm.tmHeight;;
*y = (double)tm.tmHeight;
} else {
*y = (double)ty;
}