Gfx: Make D2D clip text that overflows the bounding box similarly to GDI+

This commit is contained in:
Birunthan Mohanathas 2013-08-10 12:13:59 +03:00
parent 38ec6c3832
commit 616f986181

View File

@ -341,10 +341,15 @@ void CanvasD2D::DrawTextW(const WCHAR* str, UINT strLen, const TextFormat& forma
textLayout->SetCharacterSpacing(emOffset, emOffset, 0.0f, range); textLayout->SetCharacterSpacing(emOffset, emOffset, 0.0f, range);
} }
// TODO: Check for transformation.
m_Target->PushAxisAlignedClip(ToRectF(rect), D2D1_ANTIALIAS_MODE_ALIASED);
m_Target->DrawTextLayout( m_Target->DrawTextLayout(
D2D1::Point2F(xPos, rect.Y - 1.0f), D2D1::Point2F(xPos, rect.Y - 1.0f),
formatD2D.m_TextLayout.Get(), formatD2D.m_TextLayout.Get(),
solidBrush.Get()); solidBrush.Get());
m_Target->PopAxisAlignedClip();
} }
} }