From 8a0eff8ef62065165933e470091cfd632b9b21db Mon Sep 17 00:00:00 2001 From: Aloshi Date: Fri, 20 Sep 2013 22:06:50 -0500 Subject: [PATCH] Fix wrapping text that ends with a newline. --- src/Font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Font.cpp b/src/Font.cpp index 57a5eaf64..329b6c12e 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -415,7 +415,7 @@ std::string Font::wrapText(std::string text, float xLen) const } } - if(!out.empty()) //chop off the last newline + if(!out.empty() && newline == std::string::npos) //chop off the last newline if we added one out.erase(out.length() - 1, 1); return out;