X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/555b2ce915db0cb437a6c6f4e136d7956052b54f..15f0ad701496612df8c145e8e46d4b38515c0bbf:/src/generic/vscroll.cpp diff --git a/src/generic/vscroll.cpp b/src/generic/vscroll.cpp index 1f2c1c16b1..cee98cef45 100644 --- a/src/generic/vscroll.cpp +++ b/src/generic/vscroll.cpp @@ -772,16 +772,20 @@ void wxHVScrolledWindow::SetRowColumnCounts(size_t rowCount, size_t columnCount) // recalculate the scrollbars parameters if(m_rowsFirst >= rowCount) - m_rowsFirst = rowCount-1; + m_rowsFirst = (rowCount > 0) ? rowCount - 1 : 0; if(m_columnsFirst >= columnCount) - m_columnsFirst = columnCount-1; + m_columnsFirst = (columnCount > 0) ? columnCount - 1 : 0; +#if 0 + // checks disabled due to size_t type of members + // but leave them here if anyone would want to do some debugging if(m_rowsFirst < 0) m_rowsFirst = 0; if(m_columnsFirst < 0) m_columnsFirst = 0; +#endif ScrollToRowColumn(m_rowsFirst, m_columnsFirst); } @@ -993,7 +997,7 @@ bool wxHVScrolledWindow::Layout() y = -GetRowsHeight(0, GetVisibleRowsBegin()); x = -GetColumnsWidth(0, GetVisibleColumnsBegin()); GetVirtualSize(&w, &h); - GetSizer()->SetDimension(0, y, w, h); + GetSizer()->SetDimension(x, y, w, h); return true; }