-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Make the steps in the Pattern Editor scalable #7175
base: master
Are you sure you want to change the base?
Make the steps in the Pattern Editor scalable #7175
Conversation
Replace the pngs of the step buttons with the svgs from the previous branch. Adjust the code so they are rendered with the maximum available height.
Ensure minimal height of 24 pixels like the pngs. Take border offsets into account.
Fix the method `mousePressEvent` so that it also works with the larger step buttons. The main change is the adjusted check for the y coordinate. All other changes are just refactoring and reformatting of the method's code.
Extract the computation of the selected step into a dedicated method in `MidiClipView`. The removes duplicated code in the mouse press and wheel event handling code. The method `getStep` returns an `std::optional` which contains the value of the step if the calculation was successful. It also contains the check for the height. The calculation with floats was removed in `getStep` as it should not be necessary. Adjust `MidiClipView::wheelEvent` so that it now computes the step in the same way as the mouse event handler. This reinstates the functionality to set the note velocities with the mouse wheel even if the beat pattern is enlarged.
Adjust `data/themes/CMakeLists.txt` so that SVGs in the theme directories are also installed.
@Z3R0C, the mouse wheel functionality is reinstated with commit 0959b6d which removes some duplicated code and ensures that the mouse and wheel events determine the steps in the same way. Commit eb80173 fixes the problem with the SVGs in the theme folders not being installed. Can you please check again? |
Now everything works fine. Nearly. There is another problem. screen01-2024-04-22_01.29.51.mp4screen01-2024-04-22_02.04.46.mp4 |
Thanks for testing @Z3R0C! I was able to reproduce a weird rendering bug: It seems like some of the elements are rendered scaled with the correct height and some are not. I'll have to check... |
Fix artifacts that occur when Qt is requested to render SVGs into very small pixmaps. This is done by making sure that the SVG is always rendered into pixmaps that are at least 24x24 in size (the size of the original PNG pixmap). Adjust the pixmap drawing code so that a potentially larger source pixmap is drawn into a smaller target pixmap.
This pull request makes the steps in the Pattern Editor scalable and renders them with SVGs instead of PNGs. That way they look more "crisp" than with the current bitmap based implementation.
Here's a pattern with the changes in this pull request (click images to view in full size):
Here's how the same pattern looks without the changes, i.e. in
master
:This fixes #3683.