From: Paul Cornett Date: Sun, 4 Jun 2006 21:18:45 +0000 (+0000) Subject: avoid gtk assert on negative window size X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fb18afdd86e8796dc94fb114d94eb97da6168b78 avoid gtk assert on negative window size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 3d257acc26..86728b90ab 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -92,7 +92,7 @@ void wxScrollHelperNative::DoAdjustScrollbar(GtkRange* range, // with a page size of 1. This will also clamp position to 0. int upper = 1; int page_size = 1; - if (pixelsPerLine > 0 && winSize < virtSize) + if (pixelsPerLine > 0 && winSize > 0 && winSize < virtSize) { upper = (virtSize + pixelsPerLine - 1) / pixelsPerLine; page_size = winSize / pixelsPerLine;