diff --git a/src/dlangui/graphics/fonts.d b/src/dlangui/graphics/fonts.d index e01bcd53..7abd0f88 100644 --- a/src/dlangui/graphics/fonts.d +++ b/src/dlangui/graphics/fonts.d @@ -502,8 +502,8 @@ struct SimpleTextFormatter { if (ch == '\t' || ch == ' ') { // track last word end if (prevChar != '\t' && prevChar != ' ' && prevChar != 0) { - lastWordEnd = i - 1; - lastWordEndX = widths[i - 1]; + lastWordEnd = i; + lastWordEndX = widths[i]; } prevChar = ch; continue;