anchor.diff:                                     10))) ; picked an arbitrary number - BTS
                            old-y)))))
   
  -(defun is-in-scroller-pane (pane)
  +(defmethod pane-viewport ((pane basic-pane))
     (let ((parent (sheet-parent pane)))
  -    (and (typep parent 'viewport-pane)
  -         (typep (sheet-parent parent) 'scroller-pane))))
  -
  -(defmethod pane-viewport ((pane basic-pane))
  -  (when (is-in-scroller-pane pane)
  -    (sheet-parent pane)))
  +    (if (and parent (not (typep parent 'viewport-pane)))
  +	(pane-viewport parent)
  +      parent)))
   
   (defmethod pane-viewport-region ((pane basic-pane))
  -  (when (is-in-scroller-pane pane)
  -    (sheet-region pane)))
  +  (let ((viewport (pane-viewport pane)))
  +    (if viewport
  +	(sheet-region viewport))))
   
   (defmethod pane-scroller ((pane basic-pane))
  -  (when (is-in-scroller-pane pane)
  -    (sheet-parent (sheet-parent pane))))
  -
  -(defun update-scroll-bars (pane entire-region x y)
  -  (declare (ignore pane entire-region x y))
  +  (let ((viewport (pane-viewport pane)))
  +    (if viewport
  +	(sheet-parent viewport))))
  +
  +(defun update-scroll-bars (pane)
  +  (declare (ignore pane))
     #+ignore(multiple-value-bind (min-x min-y max-x max-y) (bounding-rectangle* entire-region)
       (with-slots (vscrollbar hscrollbar viewport) (pane-scroller pane)
         (when vscrollbar
  
positive.code: 				      (height nil height-p)
  				      (min-height nil min-height-p)
  				      (max-height nil max-height-p))
    (with-slots (sr-width sr-height sr-max-width sr-max-height
  	       sr-min-width sr-min-height) pane
      (when width-p (setf sr-width width))
      (when min-width-p (setf sr-min-width min-width))
      (when max-width-p (setf sr-max-width max-width))
      (when height-p (setf sr-height height))
      (when min-height-p (setf sr-min-height min-height))
      (when max-height-p (setf sr-max-height max-height)))
    (if resize-frame
        ;; we didn't find the :resize-frame option in define-application-frame
        (layout-frame (pane-frame pane))
  
negative.code: 	(dispatch-repaint hscrollbar (sheet-region hscrollbar))))))
  
  (defmethod scroll-extent ((pane basic-pane) x y)
    (let ((viewport (pane-viewport pane)))
      (when viewport
        (set-bounding-rectangle-position (sheet-region pane) x y)
        ;; find out the coordinates, in the coordinates system of
        ;; pane, of the upper-left corner, i.e. the one with
        ;; coordinates (0,0) in the viewport
        (multiple-value-bind (x0 y0)
  	  (untransform-position (sheet-transformation pane) 0 0)
  	(let ((dx (- x0 x))
  	      (dy (- y0 y)))
  	  ;; alter the sheet transformation to reflect the new position
  	  (setf (sheet-transformation pane)
  	    (make-translation-transformation (- x) (- y)))
            (update-scroll-bars pane)
  	  ;; see if we can use any of the existing output via blting
  	  (with-bounding-rectangle* (x1 y1 x2 y2) (sheet-region pane)
  	    (cond
  	     ((and (zerop dx)
  		   (< (abs dy) (- y2 y1)))
  	      (scroll-area pane 0 dy)
  	      (cond
  	       ((< dy 0)
  		(medium-clear-area (sheet-medium pane) 0 (+ y2 dy) (- x2 x1) (- y2 y1))
  		(handle-repaint pane (make-bounding-rectangle x1 (+ y2 dy) x2 y2)))
  	       (t
  		(medium-clear-area (sheet-medium pane) 0 0 (- x2 x1) dy)
  		(handle-repaint pane (make-bounding-rectangle x1 y1 x2 (+ y1 dy))))))
  	     ((and (zerop dy)
  		   (< (abs dx) (- x2 x1)))
  	      (scroll-area pane dx 0)
  	      (cond
  	       ((< dx 0)
  		(medium-clear-area (sheet-medium pane) (+ x2 dx) 0 (- x2 x1) (- y2 y1))
  		(handle-repaint pane (make-bounding-rectangle (+ x2 dx) y1 x2 y2)))
  	       (t
  		(medium-clear-area (sheet-medium pane) 0 0 dx (- y2 y1))
  		(handle-repaint pane (make-bounding-rectangle x1 y1 (+ x1 dx) y2)))))
  	     (t
  	      (medium-clear-area (sheet-medium pane) 0 0 (- x2 x1) (- y2 y1))
  	      (handle-repaint pane (sheet-region pane))))))))))
  
  ;;; LABEL PANE
  
  