From 8f6fba34633ee7039655cb60497c3d71c629b2ff Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 19 May 2004 22:42:02 +0000 Subject: * Fix to the "can't select last menu item" bug --- src/ui/ui_shared.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/ui_shared.c') diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 002d9219..8bc2c1d4 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -3953,13 +3953,13 @@ void Item_ListBox_Paint(itemDef_t *item) { DC->drawRect(x, y, listPtr->elementWidth-1, listPtr->elementHeight-1, item->window.borderSize, item->window.borderColor); } + listPtr->endPos++; size -= listPtr->elementWidth; if (size < listPtr->elementWidth) { listPtr->drawPadding = size; //listPtr->elementWidth - size; break; } x += listPtr->elementWidth; - listPtr->endPos++; // fit++; } } else { @@ -4067,19 +4067,19 @@ void Item_ListBox_Paint(itemDef_t *item) { DC->fillRect(x + 2, y + 2, item->window.rect.w - SCROLLBAR_SIZE - 4, listPtr->elementHeight, item->window.outlineColor); } + listPtr->endPos++; size -= listPtr->elementHeight; if (size < listPtr->elementHeight) { listPtr->drawPadding = listPtr->elementHeight - size; break; } - listPtr->endPos++; y += listPtr->elementHeight; // fit++; } } } - //TA: fix to off-by-one bug + //TA: FIXME: hacky fix to off-by-one bug listPtr->endPos--; } -- cgit