Skip to content

Commit

Permalink
Fix OpenTTD#11752: [Win32] Wrong multi-line text layout due to incorr…
Browse files Browse the repository at this point in the history
…ect partial run handling (OpenTTD#11761)
  • Loading branch information
glx22 authored Jan 12, 2024
1 parent 28efa65 commit 03df70c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/os/windows/string_uniscribe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static std::vector<SCRIPT_ITEM> 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;
Expand Down

0 comments on commit 03df70c

Please sign in to comment.