Gfx: Fix non-zero height for empty strings with D2D

http://rainmeter.net/forum/viewtopic.php?p=92801
This commit is contained in:
Brian Ferguson 2013-10-08 20:10:57 +03:00 committed by Birunthan Mohanathas
parent 15c65384f6
commit 35f2e1591e

View File

@ -404,9 +404,12 @@ bool CanvasD2D::MeasureTextLinesW(const WCHAR* str, UINT strLen, const TextForma
rect.Height = metrics.height;
lines = metrics.lineCount;
// GDI+ draws multi-line text even though the last line may be clipped slightly at the bottom.
// This is a workaround to emulate that behaviour.
rect.Height += 1.0f;
if (rect.Height > 0.0f)
{
// GDI+ draws multi-line text even though the last line may be clipped slightly at the
// bottom. This is a workaround to emulate that behaviour.
rect.Height += 1.0f;
}
return true;
}