From a42c8c0806aae9525ca21bd20d1c7fc4f2e69b4b Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 27 Mar 2015 13:12:48 +0300 Subject: [PATCH] fix SimpleTextFormatter --- examples/example1/src/example1.d | 2 +- src/dlangui/graphics/fonts.d | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/example1/src/example1.d b/examples/example1/src/example1.d index f0fb6256..a2f83573 100644 --- a/examples/example1/src/example1.d +++ b/examples/example1/src/example1.d @@ -341,7 +341,7 @@ extern (C) int UIAppMain(string[] args) { window.close(); return true; } else if (a.id == 41) { - window.showMessageBox(UIString("About"d), UIString("DLangUI demo app\n(C) Vadim Lopatin, 2014\nhttp://github.com/buggins/dlangui\n"d)); + window.showMessageBox(UIString("About"d), UIString("DLangUI demo app\n(C) Vadim Lopatin, 2014\nhttp://github.com/buggins/dlangui"d)); return true; } else if (a.id == ACTION_FILE_OPEN) { UIString caption; diff --git a/src/dlangui/graphics/fonts.d b/src/dlangui/graphics/fonts.d index 9ea85c10..39fccb35 100644 --- a/src/dlangui/graphics/fonts.d +++ b/src/dlangui/graphics/fonts.d @@ -481,7 +481,7 @@ struct SimpleTextFormatter { if (ch == '\n' || i == charsMeasured) { // split by EOL char or at end of text dstring line = cast(dstring)text[lineStart .. i]; - int lineEndX = (i == charsMeasured) || (i == lineStart) ? lineStartX : widths[i - 1]; + int lineEndX = (i == lineStart) ? lineStartX : widths[i - 1]; int lineWidth = lineEndX - lineStartX; sz.y += lineHeight; if (sz.x < lineWidth)