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

Waveform: avoid QPainter glitch with ranges < 1 px #4804

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Jun 14, 2022

Noticed when setting loop_in and loop_out at the same position (it's not, seems they are correct to be 1+ samples apart):
If the range is < 1 xp, as long as the range start marker is visible in the waveform, the range would be rendered to span until the end of the view.

Can't tell what the actual issue is, QPainter with QRectF // rendering engine?
It's strange though: the glitch does not occur at zoom levels 16.7%, 50% and 100% (on FullHD screen, LateNight @ min width) where the range rectangle width is 0.25 * [odd int].
Anyway, rounding up the width to 1 px solves the issue on all zoom levels.

zoom rect.width() okay?
10% 0.15
11% 0.166
12.5 0.1875
14.3% 0.214
16.7% 0.25 ✔️
20% 0.3
25% 0.375
33.3% 0.5
50% 0.75 ✔️
100% 1.5 ✔️

I don't mind if this goes into 2.3.3 or the next release

@ronso0 ronso0 marked this pull request as ready for review June 14, 2022 23:49
Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

Thanks. Lets wait for the 2.3.3 release first since this is low priority.

@ronso0
Copy link
Member Author

ronso0 commented Jun 15, 2022

Sure.
Maybe someone can figure out was actually causes issue when using those width/height values

painter->drawImage(rect, *selectedImage, rect);

@ronso0
Copy link
Member Author

ronso0 commented Jun 15, 2022

FWIW
using

painter->drawImage(rect.topLeft(), *selectedImage, rect);

doesn't prevent the glitch.

@Swiftb0y
Copy link
Member

2.3.3 was released. Merge?

@ronso0
Copy link
Member Author

ronso0 commented Jun 22, 2022

Sure.

@Swiftb0y Swiftb0y merged commit 8facfb6 into mixxxdj:2.3 Jun 22, 2022
@ronso0 ronso0 deleted the waveform-tiny-range-fix branch June 22, 2022 20:34
@ronso0 ronso0 added this to the 2.3.4 milestone Jul 11, 2022
napaalm added a commit to napaalm/mixxx that referenced this pull request Mar 23, 2023
…ge-fix"

This reverts commit 8facfb6, reversing
changes made to 690e776.
napaalm added a commit to napaalm/mixxx that referenced this pull request Mar 23, 2023
…ge-fix"

This reverts commit 8facfb6, reversing
changes made to 690e776.
napaalm added a commit to napaalm/mixxx that referenced this pull request Mar 24, 2023
…ge-fix"

This reverts commit 8facfb6, reversing
changes made to 690e776.
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.

2 participants