Skip to content

Commit

Permalink
Fixed mouse scroll on lists going out of range, closes #660
Browse files Browse the repository at this point in the history
  • Loading branch information
krzys-h committed Oct 1, 2015
1 parent 2111c6d commit 883e07a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/controls/list.cpp
Expand Up @@ -281,10 +281,10 @@ bool CList::EventProcess(const Event &event)
{
auto data = event.GetData<MouseWheelEventData>();
m_firstLine -= data->y;
if (m_firstLine < 0)
m_firstLine = 0;
if (m_firstLine > m_totalLine - m_displayLine)
m_firstLine = m_totalLine - m_displayLine;
if (m_firstLine < 0)
m_firstLine = 0;

UpdateScroll();
UpdateButton();
Expand Down

0 comments on commit 883e07a

Please sign in to comment.