X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..ab473127c64c9e20c3401bd8f0e173953c049d45:/src/generic/vscroll.cpp?ds=sidebyside diff --git a/src/generic/vscroll.cpp b/src/generic/vscroll.cpp index 6c072dc9ab..30b888bb2e 100644 --- a/src/generic/vscroll.cpp +++ b/src/generic/vscroll.cpp @@ -92,7 +92,7 @@ wxCoord wxVScrolledWindow::EstimateTotalHeight() const // use the height of the lines we looked as the average heightTotal = (wxCoord) - (((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax); + (((float)heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax); } return heightTotal; @@ -374,6 +374,7 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event) size_t lineFirstNew; const wxEventType evtType = event.GetEventType(); + if ( evtType == wxEVT_SCROLLWIN_TOP ) { lineFirstNew = 0; @@ -398,21 +399,19 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event) { lineFirstNew = GetLastVisibleLine(); } - else // unknown scroll event? + else if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE ) { - if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE ) - { - lineFirstNew = event.GetPosition(); - } - else - { - wxASSERT_MSG( evtType == wxEVT_SCROLLWIN_THUMBTRACK, - _T("unknown scroll event type?") ); + lineFirstNew = event.GetPosition(); + } + else if ( evtType == wxEVT_SCROLLWIN_THUMBTRACK ) + { + lineFirstNew = event.GetPosition(); + } - // don't do anything, otherwise dragging the thumb around would - // be too slow - return; - } + else // unknown scroll event? + { + wxFAIL_MSG( _T("unknown scroll event type?") ); + return; } ScrollToLine(lineFirstNew);