 CONSTANT: min-thumb-dim 30
 
 : visible-portion ( slider -- n )
-    [ slider-page ] [ slider-max 1 max ] bi / 1 min ;
+    [ slider-page ]
+    [ slider-length 1 max ]
+    bi / 1 min ;
 
 : thumb-dim ( slider -- h )
     [

    #! x*n is the screen position of the thumb, and conversely
    #! for x/n. The '1 max' calls avoid division by zero.
    [ [ elevator-length ] [ thumb-dim ] bi - 1 max ]
    [ slider-max* 1 max ]
    bi / ;

: slider>screen ( m slider -- n ) slider-scale * ;

        swap >>orientation ;

: thumb-loc ( slider -- loc )
    [ slider-value ]
    [ slider-min - ]
    [ slider>screen elevator-padding + ] tri ;

: layout-thumb-loc ( thumb slider -- )
    [ thumb-loc ] [ orientation>> ] bi n*v
