restore and document scrolling behavior
Closes PR 11583, and everts the previous fix for PR 10853 and fixes it in a different way
This commit is contained in:
parent
5eb2739bdf
commit
b0095111d4
|
@ -2909,14 +2909,12 @@ module browser threading seems wrong.
|
|||
(define (set-visible-regions txt regions)
|
||||
(when regions
|
||||
(for-each (λ (canvas region)
|
||||
(send canvas call-as-primary-owner
|
||||
(λ ()
|
||||
(let ([admin (send txt get-admin)])
|
||||
(send admin scroll-to
|
||||
(first region)
|
||||
(second region)
|
||||
(third region)
|
||||
(fourth region))))))
|
||||
(set-visible-region canvas
|
||||
(first region)
|
||||
(second region)
|
||||
(third region)
|
||||
(fourth region)
|
||||
#f))
|
||||
(send txt get-canvases)
|
||||
regions)))
|
||||
|
||||
|
|
|
@ -1131,17 +1131,17 @@
|
|||
|
||||
(define/public (do-scroll-to localx localy w h refresh? bias prev? next? only-focus?)
|
||||
(and canvas
|
||||
(or (and (or (send canvas is-focus-on?)
|
||||
(not only-focus?))
|
||||
(list (send canvas scroll-to localx localy w h refresh? bias)))
|
||||
(and (not (send canvas is-focus-on?))
|
||||
(or (and (not (send canvas is-focus-on?))
|
||||
(or
|
||||
(and prev?
|
||||
prevadmin
|
||||
(send prevadmin do-scroll-to localx localy w h refresh? bias #t #f #t))
|
||||
(and next?
|
||||
nextadmin
|
||||
(send nextadmin do-scroll-to localx localy w h refresh? bias #f #t #t)))))))
|
||||
(send nextadmin do-scroll-to localx localy w h refresh? bias #f #t #t))))
|
||||
(and (or (not only-focus?)
|
||||
(send canvas is-focus-on?))
|
||||
(list (send canvas scroll-to localx localy w h refresh? bias))))))
|
||||
|
||||
(def/override (grab-caret [(symbol-in immediate display global) dist])
|
||||
(when canvas
|
||||
|
|
|
@ -273,8 +273,12 @@ The @scheme[bias] argument is one of:
|
|||
The return value is @scheme[#t] if the @techlink{display} is scrolled,
|
||||
@scheme[#f] if not (either because the requested region is already
|
||||
visible, because the @techlink{display} has zero size, or because the
|
||||
editor is currently printing.)
|
||||
editor is currently printing).
|
||||
|
||||
If an editor has multiple @techlink{displays}, then if any display
|
||||
currently has the keyboard focus, it is scrolled. Otherwise, the
|
||||
``primary owner'' of the editor (see @method[editor-canvas%
|
||||
call-as-primary-owner]) is scrolled.
|
||||
|
||||
}
|
||||
@methimpl{
|
||||
|
|
Loading…
Reference in New Issue
Block a user