From d80cb3436cb2772385a58dff9c7562fd40c4d276 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Fri, 4 Dec 2009 20:08:24 +0000 Subject: [PATCH] Correct max width --- menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu.cpp b/menu.cpp index ab85cd1..594e4d1 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1,6 +1,6 @@ /********************************************************************* * -* Copyright (C) 2004,2008, Simon Kagstrom +* Copyright (C) 2004-2009, Simon Kagstrom * * Filename: menu.c * Author: Simon Kagstrom @@ -29,7 +29,7 @@ void Menu::printText(SDL_Surface *where, const char *msg, SDL_Color clr, tw = this->font->getWidth(buf); /* Crop text */ - if (x + tw > w) + if (tw > w) { int pixels_per_char = tw / strlen(buf); int last_char = (w / pixels_per_char) - 1;