Skip to content
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

Adding proportional scrolling #7476

Merged
merged 6 commits into from
Oct 6, 2024

Conversation

regulus79
Copy link
Contributor

Fixes #7474 by making the scroll amount change based on the zoom amount.

The implementation is slightly different in the SongEditor versus the PianoRoll and the AutomationEditor, since the SongEditor has precise zoom control while the others have zoom levels. I opted to use pixelsPerBar() in the SongEditor to calculate the zoom level for simplicity, since the zooming model is in log scale.

I actually had this on feature my mind awhile ago when I was implementing continuous autoscrolling, but I decided to leave it to a different pr and forgot about it. Now I've been reminded, so here it is.

Also, please let me know if the scrolling speed is too fast/too slow. Currently the scrolling speed is equal to the old scrolling speed at default zoom.

@yohannd1
Copy link

Just checked it out and it's working great! Thanks.
I do think the scrolling speed is too slow - I think it should be around the same amount as the vertical scrolling, but I'm not fully sure about that. Maybe the best would be to implement an option to adjust that? Not sure how complicated that would be.

@regulus79
Copy link
Contributor Author

Alright, I sped up the horizontal scrolling in the Piano Roll and Automation Editor by about 3x, so now the Piano Roll's horizontal scrolling is closer to the speed of the vertical scrolling. I didn't do exactly 3x, since that made it scroll exactly 1 beat, which made the grid pattern line up and look odd like it wasn't scrolling.

@yohannd1
Copy link

It seems good now!

@@ -241,6 +241,8 @@ protected slots:
QScrollBar * m_leftRightScroll;
QScrollBar * m_topBottomScroll;

void incrementLeftRightScoll(int value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just noticed that something like update or adjust would have been better than increment. The reason is that it does not always increment but can also decrement depending on the sign of value.

However, I don't want to be too picky. 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

@michaelgregorius michaelgregorius merged commit 7dbc809 into LMMS:master Oct 6, 2024
11 checks passed
mmeeaallyynn pushed a commit to mmeeaallyynn/lmms that referenced this pull request Oct 27, 2024
Add proportional scrolling to the song editor, piano roll and automation editor. Proportional scrolling means that if for example a certain measure is on the right side of the song editor then it will take a certain number of mouse wheel moves to get it to the left side of the editor. It is the same number of wheel moves regardless of the zoom level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proportional horizontal scroll
3 participants