Created
November 22, 2019 01:12
-
-
Save Drainful/dce0e5dcbb62e334e1e14a360b36f1fd to your computer and use it in GitHub Desktop.
Versions of the Next scroll to top/bottom functions which function regardless of current zoom.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-parenscript %scroll-to-top--scaled | |
((scale (next:current-zoom-ratio (next:current-buffer)))) | |
(ps:chain window (scroll-by 0 (* (ps:lisp scale) | |
(- (ps:chain document body scroll-height)))))) | |
(define-parenscript %scroll-to-bottom--scaled | |
((scale (next:current-zoom-ratio (next:current-buffer)))) | |
(ps:chain window (scroll-by 0 (* (ps:lisp scale) | |
(ps:chain document body scroll-height))))) | |
(define-command scroll-to-top--scaled () | |
"Scroll to the top of the page regardless of zoom" | |
(%scroll-to-top--scaled)) | |
(define-command scroll-to-bottom--scaled () | |
"Scroll to the top of the page regardless of zoom" | |
(%scroll-to-bottom--scaled)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment