Skip to content

Commit

Permalink
Fix auto wrapping of text with explict newlines
Browse files Browse the repository at this point in the history
Previous changes to avoid including whitespace in width calculations
accidentally broke layout if the text contained intentional newlines.
They were previously handled correctly implicitly, before the change to
trim unnecessary whitespace, which now requires explicitness.

Fixes: 2b3b873 ("Improve AutoWrappingText trimming")

Fixes #878
  • Loading branch information
vslavik committed Jan 27, 2025
1 parent f153635 commit f08944c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/customcontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ wxString WrapTextAtWidth(const wxString& text_, int width, Language lang, wxWind
else if (pos > 0 && text[pos-1] == '\n') // forced line feed
{
out += substr;
out += '\n';
#ifdef BIDI_NEEDS_DIRECTION_ON_EACH_LINE
if (directionMark)
out += directionMark;
#endif
lineStart = pos;
previousSubstr.clear();
}
Expand Down

0 comments on commit f08944c

Please sign in to comment.