racket/gui: avoid editor refresh for no-op scroll wheel
This commit is contained in:
parent
faab297ab9
commit
eb2a74aaba
|
@ -942,19 +942,29 @@
|
||||||
|
|
||||||
(maybe-reset-size)
|
(maybe-reset-size)
|
||||||
|
|
||||||
(when (and (x . > . -1)
|
(define change?
|
||||||
(not fake-x-scroll?))
|
(or
|
||||||
(when (positive? scroll-width)
|
;; Set x
|
||||||
(set-scroll-pos 'horizontal (min (->long (min x scroll-width)) 10000000))))
|
(and (x . > . -1)
|
||||||
|
(not fake-x-scroll?)
|
||||||
(when (and (y . > . -1)
|
(positive? scroll-width)
|
||||||
(not fake-y-scroll?))
|
(let ([x (min (->long (min x scroll-width)) 10000000)])
|
||||||
(when (positive? scroll-height)
|
(and (not (= x old-x))
|
||||||
(set-scroll-pos 'vertical (min (->long (min y scroll-height)) 10000000))))
|
(begin (set-scroll-pos 'horizontal x)
|
||||||
|
#t))))
|
||||||
|
;; Set y
|
||||||
|
(and (y . > . -1)
|
||||||
|
(not fake-y-scroll?)
|
||||||
|
(positive? scroll-height)
|
||||||
|
(let ([y (min (->long (min y scroll-height)) 10000000)])
|
||||||
|
(and (not (= y old-y))
|
||||||
|
(begin
|
||||||
|
(set-scroll-pos 'vertical y)
|
||||||
|
#t))))))
|
||||||
|
|
||||||
(set! noloop? savenoloop?)
|
(set! noloop? savenoloop?)
|
||||||
|
|
||||||
(when refresh?
|
(when (and change? refresh?)
|
||||||
(if (and #f ;; special scrolling disabled: not faster with Cocoa, broken for Windows
|
(if (and #f ;; special scrolling disabled: not faster with Cocoa, broken for Windows
|
||||||
(not need-refresh?)
|
(not need-refresh?)
|
||||||
(not lazy-refresh?)
|
(not lazy-refresh?)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user