-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrollfix #4554
Scrollfix #4554
Conversation
Directly apply fractional delta values to scrollbar instead of rounding them first before applying.
Directly apply fractional delta values to scrollbar instead of rounding them first before applying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this really does make the scrolling experience way more consistent and enjoyable, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miniksa or @DHowett-MSFT I think we don't have Chromium Math in this repo. Is it ok to #include
that at the top of this or was there a particular reason we didn't do that.
@jamestut Just in case you're not familiar with it, for reference on how to use this Chromium Math, here's the doc or just search our repo for base::Clamp
and you should find a decent amount of examples.
Works great! 😊
const auto currentOffset = this->GetScrollOffset(); | ||
const double newValue = (numRows) + (currentOffset); | ||
const auto currentOffset = _scrollBar.Value(); | ||
const double newValue = numRows + currentOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use safemath here to force a clamped double.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the chromium's safemath here for the clamped addition on the 3rd commit of this fork.
#4179 is awaiting someone to pick up before we use chromium math in the repo. |
Argh: I'm really sorry about the conflict. You will need to save and commit TermControl as CRLF, then merge in master. I was not aware that we had messed up the line endings so badly. :/ |
FWIW: i did push a fixed version here; 9dc594b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so so so much better.
I pushed this commit to master after doing a build test myself. Consider this merged, and congrats on your first contribution! |
This parameter was added as a workaround for our fast trackpad scrolling. Since that was fixed before 1.0 shipped, in #4554, it has been largely vestigial. There is no reason for us to keep it around any longer. It was also the only "logic" in TerminalSettings, which is otherwise a library that only transits data between two other libraries. I have not removed it from the schema, as I do not want to mark folks' settings files invalid to a strict schema parser. While I was in the area, I added support for "scroll one screen at a time" (which is represented by the API returning -1), fixing #5610. Fixes #5610
This parameter was added as a workaround for our fast trackpad scrolling. Since that was fixed before 1.0 shipped, in #4554, it has been largely vestigial. There is no reason for us to keep it around any longer. It was also the only "logic" in TerminalSettings, which is otherwise a library that only transits data between two other libraries. I have not removed it from the schema, as I do not want to mark folks' settings files invalid to a strict schema parser. While I was in the area, I added support for "scroll one screen at a time" (which is represented by the API returning WHEEL_PAGESCROLL), fixing #5610. We were also storing it in an int (whoops) instead of a uint. Fixes #5610
#6891) This parameter was added as a workaround for our fast trackpad scrolling. Since that was fixed before 1.0 shipped, in #4554, it has been largely vestigial. There is no reason for us to keep it around any longer. It was also the only "logic" in TerminalSettings, which is otherwise a library that only transits data between two other libraries. I have not removed it from the schema, as I do not want to mark folks' settings files invalid to a strict schema parser. While I was in the area, I added support for "scroll one screen at a time" (which is represented by the API returning WHEEL_PAGESCROLL), fixing #5610. We were also storing it in an int (whoops) instead of a uint. Fixes #5610
Summary of the Pull Request
Fixed inconsistent scrolling when using both touchscreen and precision touchpad.
References
#1066 and #4542
PR Checklist
Detailed Description of the Pull Request / Additional comments
Scrolling jumpiness is caused by rounding errors. Instead of retrieving the current scrolling value from
GetScrollOffset
, which is already rounded inint
, let the scrolling operation to operate on_scrollBar
'sValue
directly (which usesdouble
) inTermControl.cpp
.Validation Steps Performed
Testing scrolling on the following scenario manually:
nano
andmore
in WSL.has the same behavior between using touchscreen or precision trackpad and regular mouse wheel.