]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid gtk assert on negative window size
authorPaul Cornett <paulcor@bullseye.com>
Sun, 4 Jun 2006 21:18:45 +0000 (21:18 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 4 Jun 2006 21:18:45 +0000 (21:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/scrolwin.cpp

index 3d257acc26418fc66f55f741bb75a9c67a09dda1..86728b90ab33018bc6dd3a0808fcd0a5450b6cb8 100644 (file)
@@ -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;