From e70a48441537dd628e94edd3d5468e387de9772f Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 20 Apr 2010 15:10:27 +0000 Subject: SCI: remove lone spaces at the end of right aligned menu items. fixes "wrongly" aligned menu items in some games svn-id: r48746 --- engines/sci/graphics/menu.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/sci/graphics/menu.cpp') diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 48ff2d5cce..ed5a034250 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -218,6 +218,9 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t if (tagPos && tagPos >= rightAlignedPos) tempPos = tagPos; itemEntry->textRightAligned = Common::String(content.c_str() + rightAlignedPos, tempPos - rightAlignedPos); + // Remove ending space, if there is one. Strangely sometimes there are lone spaces at the end in some games + if (itemEntry->textRightAligned.hasSuffix(" ")) + itemEntry->textRightAligned.deleteLastChar(); // - and + are used sometimes for volume control if (itemEntry->textRightAligned == "-") { itemEntry->keyPress = '-'; -- cgit v1.2.3