Gfx: Make AccurateText=1 more consistent with GDI+ for D2D when a newline character is the last character of the text

This commit is contained in:
Birunthan Mohanathas 2013-08-10 13:58:54 +03:00
parent 6e04fd983f
commit aa4c4a6dfc

View File

@ -249,6 +249,15 @@ DWRITE_TEXT_METRICS TextFormatD2D::GetMetrics(
metrics.height += m_LineGap;
}
}
else
{
// GDI+ compatibility: With accurate metrics, the line gap needs to be subtracted
// from the overall height if the string does not contain newlines.
if (!strippedLastNewLine && wmemchr(str, L'\n', strLen) == nullptr)
{
metrics.height -= m_LineGap;
}
}
}
else
{