mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DirectWrite: Don't skip newline glyph runs when performing text layout
This commit is contained in:
parent
56f057fb65
commit
c26ff2da6b
1 changed files with 10 additions and 2 deletions
|
|
@ -90,9 +90,17 @@ namespace DirectWriteTypeLayout
|
|||
DWRITE_GLYPH_RUN const* glyphRun, DWRITE_GLYPH_RUN_DESCRIPTION const* runDescription,
|
||||
IUnknown* clientDrawingEffect) noexcept override
|
||||
{
|
||||
const String runString (runDescription->string, runDescription->stringLength);
|
||||
const auto containsTextOrNewLines = [runDescription]
|
||||
{
|
||||
const String runString (runDescription->string, runDescription->stringLength);
|
||||
|
||||
if (! runString.containsNonWhitespaceChars())
|
||||
if (runString.containsNonWhitespaceChars() || runString.containsAnyOf ("\n\r"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}();
|
||||
|
||||
if (! containsTextOrNewLines)
|
||||
return S_OK;
|
||||
|
||||
auto layout = static_cast<TextLayout*> (clientDrawingContext);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue