From e0823b82c4756c55f23e76891079f06d92b8984f Mon Sep 17 00:00:00 2001 From: Xawotihs Date: Sat, 8 Jan 2011 18:26:22 +0000 Subject: [PATCH] Fix for issue 568. It was a hard one, it probably happened more frequently with the touch/mouse interface, but this bug potentially affected all the platforms. --- projects/mtg/src/SimpleMenu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/SimpleMenu.cpp b/projects/mtg/src/SimpleMenu.cpp index 0f8b6be08..75be37236 100644 --- a/projects/mtg/src/SimpleMenu.cpp +++ b/projects/mtg/src/SimpleMenu.cpp @@ -127,7 +127,8 @@ void SimpleMenu::Render() if (0 == mWidth) { float sY = mY + kVerticalMargin; - for (int i = startId; i < startId + mCount; ++i) + + for (int i = 0; i < mCount; ++i) { float width = (static_cast (mObjects[i]))->GetWidth(); if (mWidth < width) mWidth = width; @@ -135,7 +136,7 @@ void SimpleMenu::Render() if ((!title.empty()) && (mWidth < titleFont->GetStringWidth(title.c_str()))) mWidth = titleFont->GetStringWidth(title.c_str()); mWidth += 2 * kHorizontalMargin; - for (int i = startId; i < startId + mCount; ++i) + for (int i = 0; i < mCount; ++i) { float y = mY + kVerticalMargin + i * kLineHeight; SimpleMenuItem * smi = static_cast (mObjects[i]);