Gfx: Make D2D draw lines if they will be clipped by at most 2 pixels

This commit is contained in:
Birunthan Mohanathas 2013-08-12 18:52:51 +03:00
parent db9e220207
commit 61bcb92dee

View File

@ -54,6 +54,16 @@ void TextFormatD2D::CreateLayout(
m_LastString.assign(str, strLen);
}
if (m_Trimming)
{
// GDI+ compatibility: If we trimming (i.e. clipping), GDI+ draws text lines even if they
// would be clipped. This is arguably a bad 'feature', but some in some cases the height
// might be just a pixel or two too small. In order to render those cases correctly (but
// still clipped as CanvasD2D::DrawTextW() will clip), we'll increase the max height of
// the layout.
maxH += 2.0f;
}
if (m_TextLayout && !strChanged)
{
if (maxW != m_TextLayout->GetMaxWidth())