Skip to content

Commit

Permalink
Fixed|UI: Updating list widget visible items range
Browse files Browse the repository at this point in the history
When resizing the UI, it would sometimes occur that the visible range
started at a too high index, causing the list thumb button to be drawn
in an incorrect position.
  • Loading branch information
skyjake committed May 2, 2012
1 parent c4b841a commit a9697fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doomsday/engine/portable/src/ui_main.c
Expand Up @@ -464,11 +464,14 @@ void UI_SetPage(ui_page_t* page)
dat->numvis = (ob->geometry.size.height - 2 * UI_BORDER) / listItemHeight(dat);
if(dat->selection >= 0)
{
// There is a selected item, make sure it is visible.
if(dat->selection < dat->first)
dat->first = dat->selection;
if(dat->selection > dat->first + dat->numvis - 1)
dat->first = dat->selection - dat->numvis + 1;
}
// Check that the visible range is ok.
dat->first = MIN_OF(dat->first, dat->count - dat->numvis);
UI_InitColumns(ob);
}
}
Expand Down
1 change: 0 additions & 1 deletion doomsday/engine/portable/src/window.cpp
Expand Up @@ -190,7 +190,6 @@ struct ddwindow_s
{
geometry.size.width = DisplayMode_Current()->width;
geometry.size.height = DisplayMode_Current()->height;

#ifdef MACOSX
// Pull the window again over the shield after the mode change.
DisplayMode_Native_Raise(Window_NativeHandle(this));
Expand Down

0 comments on commit a9697fb

Please sign in to comment.