Right now when you scroll the next page is loaded by how far down you've scrolled, this works but becomes laggy when a user scrolls fast to the next page. I think preloading pages in a certain range would solve this issue. Currently I have the preloading feature apart of the loadPagesInRange function(line 4879) but this solution seems hacky and would love some input on where and/or how I should implement this.
I am not sure I understand your question completely. The viewer already does a staggered preload, which pauses when the user scrolls to prevent UI latency.
Right now when you scroll the next page is loaded by how far down you've scrolled, this works but becomes laggy when a user scrolls fast to the next page. I think preloading pages in a certain range would solve this issue. Currently I have the preloading feature apart of the loadPagesInRange function(line 4879) but this solution seems hacky and would love some input on where and/or how I should implement this.