From 2e2ced74031ced1564eea99315f45745b8c1b130 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sat, 10 Aug 2013 14:14:02 +0300 Subject: [PATCH] Gfx: Additional change to 6e04fd9 --- Common/Gfx/TextFormatD2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Gfx/TextFormatD2D.cpp b/Common/Gfx/TextFormatD2D.cpp index 224b084b..df9ee0b6 100644 --- a/Common/Gfx/TextFormatD2D.cpp +++ b/Common/Gfx/TextFormatD2D.cpp @@ -201,7 +201,7 @@ DWRITE_TEXT_METRICS TextFormatD2D::GetMetrics( { // GDI+ compatibility: If the last character is a newline, GDI+ measurements seem to ignore it. bool strippedLastNewLine = false; - if (str[strLen - 1] == L'\n') + if (strLen > 2 && str[strLen - 1] == L'\n') { strippedLastNewLine = true; --strLen;