1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DirectWrite: Don't include trailing whitespace when calculating text layout in CustomDirectWriteTextRenderer::DrawGlyphRun()

This commit is contained in:
ed 2021-07-06 15:10:18 +01:00
parent e1366361ed
commit 81534104fb

View file

@ -90,6 +90,11 @@ namespace DirectWriteTypeLayout
DWRITE_GLYPH_RUN const* glyphRun, DWRITE_GLYPH_RUN_DESCRIPTION const* runDescription,
IUnknown* clientDrawingEffect) noexcept override
{
const String runString (runDescription->string, runDescription->stringLength);
if (! runString.containsNonWhitespaceChars())
return S_OK;
auto layout = static_cast<TextLayout*> (clientDrawingContext);
if (! (baselineOriginY >= -1.0e10f && baselineOriginY <= 1.0e10f))