[mcclim-cvs] CVS mcclim

thenriksen thenriksen at common-lisp.net
Tue Feb 19 22:26:06 UTC 2008


Update of /project/mcclim/cvsroot/mcclim
In directory clnet:/tmp/cvs-serv11072

Modified Files:
	gadgets.lisp 
Log Message:
Fixed division-by-zero bug in scrollbar code.


--- /project/mcclim/cvsroot/mcclim/gadgets.lisp	2007/08/21 22:09:01	1.107
+++ /project/mcclim/cvsroot/mcclim/gadgets.lisp	2008/02/19 22:26:06	1.108
@@ -1463,7 +1463,7 @@
       (let ((ts (scroll-bar-thumb-size sb)))
         ;; This is the right spot to handle ts = :none or perhaps NIL
         (multiple-value-bind (range) (gadget-range sb)
-          (let ((ts-in-pixels (round (* (- y3 y1) (/ ts (+ range ts)))))) ;### range + ts = 0?
+          (let ((ts-in-pixels (round (* (- y3 y1) (/ ts (max 1 (+ range ts))))))) ; handle range + ts = 0
             (setf ts-in-pixels (min (- y3 y1) ;thumb can't be larger than the thumb bed
                                     (max +minimum-thumb-size-in-pixels+ ;but shouldn't be smaller than this.
                                          ts-in-pixels)))




More information about the Mcclim-cvs mailing list