From 03df70ce8af258f25eaff49725676fad4bb849d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Fri, 12 Jan 2024 19:40:08 +0100 Subject: [PATCH] Fix #11752: [Win32] Wrong multi-line text layout due to incorrect partial run handling (#11761) --- src/os/windows/string_uniscribe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index dfb8ffd0c47d9..040101ec3602e 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -415,7 +415,7 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF UniscribeRun run = *i_run; /* Partial run after line break (either start or end)? Reshape run to get the first/last glyphs right. */ - if (i_run == last_run - 1 && remaining_offset < (last_run - 1)->len) { + if (i_run == last_run - 1 && remaining_offset <= (last_run - 1)->len) { run.len = remaining_offset - 1; if (!UniscribeShapeRun(this->text_buffer, run)) return nullptr;