Repository navigation
Add Continuous Auto-Scrolling - #7396
Conversation
Rossmaxx
left a comment
There was a problem hiding this comment.
Minor style review, also pay attention to codefactor.
Btw you forgot classic theme.
|
Okay, I made some icons for classic, and hopefully I've fixed all the style issues. |
f13ff3f to
0a16a93
Compare
sakertooth
left a comment
There was a problem hiding this comment.
We should do testing before merge.
Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: saker <sakertooth@gmail.com>
There was a problem hiding this comment.
I have found a bug that's introduced by this PR, i.e. that is not in master.
Steps to reproduce
- Load a song.
- Set the mode to "Continuous".
- Play the song.
- Quickly change to "Off" and then to "Paged".
The line of the play head line will not move with the play head anymore.
|
I think I found the problem. The return statement in the simplification of the stepped auto scrolling code exited the function too soon, which happened to skip the code for updating the play head line position. I fixed it by modifying the if statement to not require a return. |
Had a feeling this would break something, my bad. I got tunnel vision on that one piece of code and forgot about the surrounding function. |
|
I'll test then approve. ð |
|
I think it might be helpful to have more descriptions for the tooltip when toggling between the modes (i.e., you can tell the user what this mode will do in particular rather than simply saying "Auto scrolling", because not all modes auto scroll). |
|
I added specific tooltips for each button state: "Stepped auto scrolling", "Continuous auto scrolling", and "Auto scrolling disabled" |
sakertooth
left a comment
There was a problem hiding this comment.
LGTM, also something minor I noticed
Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
|
I realized that changing the scrolling step size also broke zooming centered around the mouse position. I have now fixed that; just a simple multiplication by |
|
Just remembered that there was another bug when drawing the rubberband selection rect, where the left side would get teleported to the left as everything scrolled. Once again, a simple division by |
|
Alright, I think those are all the necessary changes, so unless anyone spots a new issue, this should pr should be ready to merge. |
|
I have a question about this, and it is that the continuous scrolling is more fluid and consistent in the Piano Roll than in the Song Editor, since in the latter the scrolling stops suddenly and is not constant. I show you this in the following videos: Autoscrolling in Piano Roll Autoscroolling.Piano.Roll.mp4Autoscrolling in Song Editor Autoscroolling.Editor.de.Cancion.mp4Is this on purpose? Or is there some other way to improve this? |
|
Ah, whoops, I forgot to test it with smooth scroll enabled. I should have set the scroll using For now, you can temporarily fix it by disabling smooth scroll in the settings. |
Description
This pull request adds the option to have auto-scrolling continuously scroll the view to keep up with the playback.
Changes
AutoScrollStateenum changed fromEnabled/DisabledtoStepped/Continuous/DisabledTimeLineWidget.cppis changed from having 2 states (Enabled/Disabled) to having 3 states (Stepped/Continuous/Disabled)SongEditor.cppandPianoRoll.cpp, a check is added for whether the mode isSteppedorContinuous; if it'sStepped, then is runs the old code for auto-scrolling; if it'sContinuous, then it snaps the horizontal scroll to halfway behind the time line so that the line appears in the center of the view.SongEditor.cpp's horizontal scrollbar's functionality was changed to make it scroll by ticks instead of bars. This required modifyingTrackContentWidget.cppto be positioned by ticks instead of bars to properly draw the grid background.