-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: fix shifted (text) markers whe using odd scale factors #3936
Conversation
...and that appearantly depends on the icon width: the wider, the more it is shifted. |
@@ -146,6 +146,7 @@ void WaveformRenderMark::slotCuesUpdated() { | |||
|
|||
void WaveformRenderMark::generateMarkImage(WaveformMarkPointer pMark) { | |||
// Load the pixmap from file -- takes precedence over text. | |||
float devicePixelRatio = m_waveformRenderer->getDevicePixelRatio(); | |||
if (!pMark->m_pixmapPath.isEmpty()) { | |||
QString path = pMark->m_pixmapPath; | |||
QImage image = *WImageStore::getImage(path, scaleFactor()); |
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.
Here scaleFactor() is in use.
Which value has it?
I did not understand why scaleFactor() works here.
Does it?
When is the code used?
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.
scaleFactor or devicePixelRatio makes no difference here.
It's 1.0 regardless of the Qt scale factor. some leftover from custom Mixxx scaling?
this is used when markers use icons, like in Deere (Cue, loop_in/out).
then the entire part below is skipped
= the icon needs to be centered so the icon stroke (if any) aligns with the marker position on the waveform
also, the one initial problem here causing the offset is that the marker sroke is not taken from the samplePosition but directly.
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 did not understand why scaleFactor() works here.
must admit I don't understand it either.
The fixes apply to all QPainter-related calculations below.
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.
Deere uses it for its cue marker.
I can confirm that it scales fine.
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.
LGTM, Thnak you.
got it! |
https://bugs.launchpad.net/mixxx/+bug/1917253
set an non-int scale factor like
export QT_SCREEN_SCALE_FACTORS=1.37
in the images below all three markers are actually exactly one the play position.
before
this PR