fix on-scroll-to callback method when an editor has multiple canvases

closes PR 15252
This commit is contained in:
Robby Findler 2016-02-17 08:56:23 -06:00
parent 8e81b5346a
commit d88ba8d2cd

View File

@ -967,7 +967,11 @@
(when scroll-via-copy? (when scroll-via-copy?
(set! on-scroll-to-called? #t) (set! on-scroll-to-called? #t)
(begin-refresh-sequence) (begin-refresh-sequence)
(when scroll-via-copy? (when ed (send ed on-scroll-to)))) (when scroll-via-copy?
(when ed
(call-as-primary-owner
(λ ()
(send ed on-scroll-to))))))
(set-scroll-pos 'horizontal x)) (set-scroll-pos 'horizontal x))
#t)))) #t))))
;; Set y ;; Set y
@ -981,7 +985,10 @@
(when scroll-via-copy? (when scroll-via-copy?
(set! on-scroll-to-called? #t) (set! on-scroll-to-called? #t)
(begin-refresh-sequence) (begin-refresh-sequence)
(when ed (send ed on-scroll-to)))) (when ed
(call-as-primary-owner
(λ ()
(send ed on-scroll-to))))))
(set-scroll-pos 'vertical y)) (set-scroll-pos 'vertical y))
#t)))))) #t))))))
@ -1040,7 +1047,10 @@
(repaint))) (repaint)))
(when on-scroll-to-called? (when on-scroll-to-called?
(when ed (send ed after-scroll-to)) (when ed
(call-as-primary-owner
(λ ()
(send ed after-scroll-to))))
(end-refresh-sequence)))) (end-refresh-sequence))))
(define/override (set-scrollbars x y x2 y2 x3 y3 x4 y4 ?) (void)) (define/override (set-scrollbars x y x2 y2 x3 y3 x4 y4 ?) (void))