original commit: 7a7dd101a9f693a2592b71a66f99680308db2fb7
This commit is contained in:
Robby Findler 1999-07-12 23:30:12 +00:00
parent d9e2270ba0
commit 30ab843e52

View File

@ -37,12 +37,13 @@
[bb (box 0)])
(send edit get-visible-line-range bt bb)
(let* ([half (sub1 (quotient (- (unbox bb) (unbox bt)) 2))]
[last-pos (send edit position-line (send edit last-position))]
[top-pos (send edit line-start-position
(max (- new-mid-line half) 0))]
(max (min (- new-mid-line half) last-pos) 0))]
[bottom-pos (send edit line-start-position
(min (+ new-mid-line half)
(send edit position-line
(send edit last-position))))])
(max 0
(min (+ new-mid-line half)
last-pos)))])
(send edit scroll-to-position
top-pos
#f