-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
add the pixels-per-scroll-step
init argument
#4
Open
rfindler
wants to merge
2
commits into
master
Choose a base branch
from
pixels-per-scroll-snip
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ | |
|
||
(define license | ||
'(Apache-2.0 OR MIT)) | ||
|
||
(define version "1.1") |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is the default value
#f
for backwards compatibility? Everyone who wants the different behavior (I suspect most people) will now have to specify the init argument explicitly for each snip they create. This requires writing more code, and I don't think the user would want different scroll steps for different snips in their application.I think that
pixels-per-scroll-step
would better be a parameter outside the snip class. This way, we could keep the default of#f
, but the user could put a single(pict-snip-pixels-per-scroll-step 1)
call at the beginning of their program and switch to smooth scrolling for their application.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.
Yes, the default was just the same behavior as before. I'm happy to change it, tho. (It seems legitimate to consider this a bugfix!)
As for the parameter, I'd prefer to just set the default to something we think will work well for people. But do you think there will be situations where two different values will be best and also where setting things globally like that will be useful?
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'll note that in my case 1 was smoother but 10 meant less scrolling (on my trackpad) to actually see the image. So I stuck with 10 for now.
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.
Yes, I think it is better to consider this a bugfix. While it looks like different values for the scroll step might be needed for different applications, I don't think the previous behavior of not being able to scroll would have legitimate use cases.
@benknoble , I wonder if the text% (or editor-canvas%) implementation need to implement accelerated scrolling?
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.
Happy to try accelerated scrolling / help implement and test.
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.
There was some work back in 2019 that @Bogdanp and @mflatt did to improve scrolling and also some work in 2018. I forget when it was exactly but there was a big improvement at some point around that era where scrolling got some serious effort and got a lot better.
That said, there is definitely a lot more that can be done but poking around in the
mred
directory ingui-lib
might turn up some code that you'd be able to spot improvements for!