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

End of track warning on Waveform overview is incomplet when Waveform display is hiden #13418

Open
RafaelFrance opened this issue Jun 30, 2024 · 3 comments
Labels

Comments

@RafaelFrance
Copy link
Contributor

Bug Description

Tango skin

Waveform end of track warning

When Waveform display is disabled, the top border of warning "end of track" is not visible.
No probleme when Waveform display is enabled.

Version

2.5-beta-13-gc6d1d5f691

OS

Windows 11 Professionnal version 23H2

@ronso0
Copy link
Member

ronso0 commented Jul 2, 2024

For me, with 100% app scaling (both Mixxx and system), it looks like this:
image
Yes, there is some rounding issue or whatever in the paint code that makes the top border thinner than the other borders.

That issue seems to be magnified when Mixxx is scaled (by the OS in your case, as you screenshot indicates, is it 125% or even 150%?).

The paint code is here.

void WOverview::drawEndOfTrackFrame(QPainter* pPainter) {
if (m_endOfTrack) {
PainterScope painterScope(pPainter);
pPainter->setOpacity(0.8);
pPainter->setPen(QPen(QBrush(m_endOfTrackColor), 1.5 * m_scaleFactor));
pPainter->setBrush(QColor(0, 0, 0, 0));
pPainter->drawRect(rect().adjusted(0, 0, -1, -1));
}
}

The border width is 1.5 * scale factor, and the rectangle's bottom right point is shifted back inside the view box. This is to compensate for

QPainter::drawRect(const QRectF &rectangle)
Draws the current rectangle with the current pen and brush.
A filled rectangle has a size of rectangle.size(). A stroked rectangle has a size of rectangle.size() plus the pen width.

So the stroke overlaps the widget at the top and left by [stroke width / 2] but at the bottom, due to shifting, it overlaps less, hence the border appears to be drawn with different widths.
Though, I don't fully understand why this eliminates the top border entirely.

I'll take a look.

@RafaelFrance
Copy link
Contributor Author

OS is at 100%. Screenshot was at this scale.

@ronso0
Copy link
Member

ronso0 commented Jul 3, 2024

Hmm no.
This is your screenshot where I've put mine on top. Your cover art is 138x138 px, mine is 111x111 (100%), so your GUI is scaled to 125%. In your screenshot you can also see thin black borders around it that usually stem from scaling rounding offsets.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants