From 42e8d5ee225456f295658aa8d1c318fc9be1dbac Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sat, 10 Aug 2013 15:29:09 +0300 Subject: [PATCH] Gfx: Additional changes to 56218f7 --- Common/Gfx/TextFormatD2D.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Common/Gfx/TextFormatD2D.cpp b/Common/Gfx/TextFormatD2D.cpp index 916d7ab7..7314322d 100644 --- a/Common/Gfx/TextFormatD2D.cpp +++ b/Common/Gfx/TextFormatD2D.cpp @@ -83,6 +83,9 @@ void TextFormatD2D::CreateLayout( textLayout1->SetCharacterSpacing(emOffset, emOffset, 0.0f, range); } + // If only one line is visible, disable wrapping so that as much text as possible is shown + // after trimming. + // TODO: Fix this for when more than one line is visible. UINT32 lineCount = 0; DWRITE_LINE_METRICS lineMetrics[2]; HRESULT hr = m_TextLayout->GetLineMetrics(lineMetrics, _countof(lineMetrics), &lineCount); @@ -92,7 +95,6 @@ void TextFormatD2D::CreateLayout( lineMetrics[1].height == 0.0f) { m_TextLayout->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); - return; } } }