Sometimes it's useful to possess knowledge in areas that are totally unrelated to what you actually want to do.
Are you interested in learning about autopilots? :sherlock: …
fix: horizontal bar doesn't get updated (mouse scrolling on bar)
fix: horizontal touchpad scrolling isn't working (I had to fix this blindly since I still do not have the possibility to test it. André, Lauren: is it working now?)
upd: descriptions, screenshot etc.
split "use custom scrolling functions" into two separate settings for mouse and keyboard
fix: scroll buttons and horizontal background bars stopped working
fix: if you release the mouse over the scroll buttons while dragging the scroll bars, the buttons jump to the left in the options page
fix: docs.sencha.com (excluded)
So, what does an autopilot have in common with scrolling?
Well, they're now working similarly! 🙄
I deleted my core scrolling function entirely and started from scratch to get the performance up to the level of scrolling with the arrow keys.
I thought about different approaches, but all of them involved a decent amount of calculations, which would slow down scrolling again. Then it suddenly popped into my head: I learned about autopilots during my job training. They basically consist of two loops: an outer and an inner one 💡
The outer loop
is the basic interface to interact with. You can e.g. set an intended course. It'll then start to calculate all initially needed starting parameters and will also clear things up as soon as the intended course is reached.
The inner loop
starts working as soon as there is a deviation from the desired value (which you chose via the outer loop). It'll steer into the needed direction to eliminate the given offset.
And that's exactly how scrolling works now 🙂
There's an outer function which sets the target value to scroll to. Then it'll call the inner one, which will scroll to the intended position. As soon as it is reached, the first function will take over again and finish it.
Additionally, all animated ways of scrolling now use the high-performance "fake" animation which you may know out of beta 1.
André's issue (Home and End keys scroll horizontally to zero) is now fixed, too :up:
The mouse scrolling is now as direct as it can be. I hardly interfere with the whole process. What do you think about it?
And how is the general performance?