Fix bug: lines that were clipped at a window's top were not being
authorChris Hanson <org/chris-hanson/cph>
Mon, 1 Apr 1991 19:46:00 +0000 (19:46 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 1 Apr 1991 19:46:00 +0000 (19:46 +0000)
drawn correctly.

v7/src/edwin/bufwfs.scm

index 15ac8975cd95432ac9f8052f6b3fc035fb0ab84c..bfd04aedfb436a4d8ffbf1a90a587c3df4c779c6 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufwfs.scm,v 1.11 1991/04/01 10:06:21 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufwfs.scm,v 1.12 1991/04/01 19:46:00 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
            (tab-width (%window-tab-width window))
            (results substring-image-results))
        (let ((xm (fix:- xu 1))
+             (yl (fix:+ y-start yl))
              (yu (fix:+ y-start yu)))
          (let ((columns (fix:- xm xl)))
            (let loop
                ((index start-index)
                 (column-offset (fix:- start-column xl))
                 (partial 0)
-                (y (fix:+ y-start yl)))
+                (y 0))
              (if (fix:< y yu)
-                 (let ((line (screen-get-output-line screen y xl xu false)))
+                 (let ((line
+                        ;; If line is clipped off top of window, draw
+                        ;; it anyway so that index and column
+                        ;; calculations get done.  Might as well use
+                        ;; first visible line for image output so as
+                        ;; to avoid consing a dummy image buffer.
+                        (screen-get-output-line screen
+                                                (if (fix:< y yl) yl y)
+                                                xl xu false)))
                    (let ((fill-line
                           (lambda (index xl)
                             (group-image! group index end-index