;; See the file LICENSE for the full license governing this code.

(in-package :cg-user)

(defmethod center ((box box))
   (make-position (truncate (/ (box-width box) 2))
     (truncate (/ (box-height box) 2))))

;;; chee   14mar00 call scroll-range and scroll-to on the frame-child
;;;        rather than on the frame, which itself does not scroll
(defmethod scroll-to-center ((window basic-pane))
  (multiple-value-bind (scroll-width scroll-height)
      (scroll-range (frame-child window))
    (scroll-to (frame-child window)
               (make-position (truncate (/ scroll-width 2))
                              (truncate (/ scroll-height 2))))
    ))

;; end of file
