From f08944cf431a2893692d15406a0e8a2a62e8a2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Mon, 27 Jan 2025 13:28:05 +0100 Subject: [PATCH] Fix auto wrapping of text with explict newlines 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: 2b3b8735fa09 ("Improve AutoWrappingText trimming") Fixes #878 --- src/customcontrols.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/customcontrols.cpp b/src/customcontrols.cpp index b6b29b1b36..1240ce2bb0 100644 --- a/src/customcontrols.cpp +++ b/src/customcontrols.cpp @@ -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(); }