X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Ffont.cpp;h=7628f673e0f6ab1e84f7063ce6afca06981f5eac;hb=472d0ad804844d28811c86f03da74b6d6be53f1b;hp=e5b6bb12ab3fb213ac1d41d385e26e72ada21445;hpb=20efd7620620892d92b1c7df124c3a0c8df22a82;p=supertux.git diff --git a/src/video/font.cpp b/src/video/font.cpp index e5b6bb12a..7628f673e 100644 --- a/src/video/font.cpp +++ b/src/video/font.cpp @@ -243,8 +243,10 @@ Font::wrap_to_chars(const std::string& s, int line_length, std::string* overflow } std::string -Font::wrap_to_width(const std::string& s, float width, std::string* overflow) +Font::wrap_to_width(const std::string& s_, float width, std::string* overflow) { + std::string s = s_; + // if text is already smaller, return full text if (get_text_width(s) <= width) { if (overflow) *overflow = "";