Gfx: Delay creation of ellipsis with D2D

This commit is contained in:
Birunthan Mohanathas 2013-03-28 15:52:17 +02:00
parent e5100d9a9f
commit 6f81e31f10

View File

@ -104,8 +104,6 @@ void TextFormatD2D::SetProperties(const WCHAR* fontFamily, int size, bool bold,
if (SUCCEEDED(hr))
{
CanvasD2D::c_DW->CreateEllipsisTrimmingSign(m_TextFormat, &m_InlineEllipsis);
SetHorizontalAlignment(GetHorizontalAlignment());
SetVerticalAlignment(GetVerticalAlignment());
}
@ -122,6 +120,11 @@ void TextFormatD2D::SetTrimming(bool trim)
DWRITE_WORD_WRAPPING wordWrapping = DWRITE_WORD_WRAPPING_NO_WRAP;
if (trim)
{
if (!m_InlineEllipsis)
{
CanvasD2D::c_DW->CreateEllipsisTrimmingSign(m_TextFormat, &m_InlineEllipsis);
}
inlineObject = m_InlineEllipsis;
trimming.granularity = DWRITE_TRIMMING_GRANULARITY_CHARACTER;
wordWrapping = DWRITE_WORD_WRAPPING_WRAP;