Skip to content

Commit

Permalink
Gfx: Delay creation of ellipsis with D2D
Browse files Browse the repository at this point in the history
  • Loading branch information
poiru committed Mar 28, 2013
1 parent e5100d9 commit 6f81e31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Common/Gfx/TextFormatD2D.cpp
Expand Up @@ -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());
}
Expand All @@ -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;
Expand Down

0 comments on commit 6f81e31

Please sign in to comment.