don't paint an infinite number of items if the control is empty

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-04-26 00:16:07 +00:00
parent 63b3dc58be
commit b1b408af9e

View File

@@ -380,8 +380,8 @@ void wxVListBox::OnPaint(wxPaintEvent& WXUNUSED(event))
rectLine.width = clientSize.x;
// iterate over all visible lines
const size_t lineMax = GetLastVisibleLine();
for ( size_t line = GetFirstVisibleLine(); line <= lineMax; line++ )
const size_t lineMax = GetVisibleEnd();
for ( size_t line = GetFirstVisibleLine(); line < lineMax; line++ )
{
const wxCoord hLine = OnGetLineHeight(line);