From 663ff5ad98fcccdecb21b016265766f26ce00094 Mon Sep 17 00:00:00 2001 From: glx22 Date: Fri, 12 Jan 2024 18:44:22 +0100 Subject: [PATCH] Fix #11752: [Win32] Wrong multi-line text layout due to incorrect partial run handling --- 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 dfb8ffd0c4..040101ec36 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;