Gfx: Fix D2D crash with negative width/height on String meters

This commit is contained in:
Birunthan Mohanathas 2013-10-15 17:00:27 +03:00
parent 629bb927fc
commit 6d243711a6

View File

@ -54,6 +54,10 @@ void TextFormatD2D::CreateLayout(
m_LastString.assign(str, strLen); m_LastString.assign(str, strLen);
} }
// The width and height of a DirectWrite layout must be non-negative.
maxW = max(0.0f, maxW);
maxH = max(0.0f, maxH);
if (m_Trimming) if (m_Trimming)
{ {
// GDI+ compatibility: If we trimming (i.e. clipping), GDI+ draws text lines even if they // GDI+ compatibility: If we trimming (i.e. clipping), GDI+ draws text lines even if they