..
original commit: 7a7dd101a9f693a2592b71a66f99680308db2fb7
This commit is contained in:
parent
d9e2270ba0
commit
30ab843e52
|
@ -37,12 +37,13 @@
|
||||||
[bb (box 0)])
|
[bb (box 0)])
|
||||||
(send edit get-visible-line-range bt bb)
|
(send edit get-visible-line-range bt bb)
|
||||||
(let* ([half (sub1 (quotient (- (unbox bb) (unbox bt)) 2))]
|
(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
|
[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
|
[bottom-pos (send edit line-start-position
|
||||||
(min (+ new-mid-line half)
|
(max 0
|
||||||
(send edit position-line
|
(min (+ new-mid-line half)
|
||||||
(send edit last-position))))])
|
last-pos)))])
|
||||||
(send edit scroll-to-position
|
(send edit scroll-to-position
|
||||||
top-pos
|
top-pos
|
||||||
#f
|
#f
|
||||||
|
|
Loading…
Reference in New Issue
Block a user