Fixed a fix-resizer's verticality heuristic.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 30 Sep 2011 01:37:22 +0000 (18:37 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 30 Sep 2011 01:37:22 +0000 (18:37 -0700)
src/gtk/fix-layout.scm

index b55006d76836e536091146240e9ad3363b62d9a4..faf617fef1493f5ed3ce35dc78cb31b24caf2a8a 100644 (file)
@@ -735,9 +735,14 @@ USA.
 (define-method initialize-instance ((widget <fix-resizer>) width height)
   (call-next-method widget width height)
   (%trace "; (initialize-instance <fix-resizer>) "widget" "width"x"height"\n")
-  (let ((vertical? (or (and (fix:< width 1) (fix:> height 0))
-                      (fix:< height width)
-                      (error "Ambiguous verticality:" widget width height))))
+  (let ((vertical? (let ((w (if (fix:< width 1) #f width))
+                        (h (if (fix:< height 1) #f height)))
+                    (cond ((and w h (fix:> w h)) #t)
+                          ((and w h (fix:< w h)) #f)
+                          ((and (not w) h) #t)
+                          ((and w (not h)) #f)
+                          (else
+                           (error "Ambiguous verticality:" w h widget))))))
     (set-fix-resizer-stack-vertical?! widget vertical?)))
 
 (define-method fix-widget-realize-callback ((widget <fix-resizer>))