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

ScrollPane border paint problem at large scalings #743

Open
tristanzhou opened this issue Oct 5, 2023 · 2 comments
Open

ScrollPane border paint problem at large scalings #743

tristanzhou opened this issue Oct 5, 2023 · 2 comments

Comments

@tristanzhou
Copy link

I've seen the four sides of a ScrollPane border painted with different thicknesses at large scalings: 125% ~ 175%.
Any idea that we can work around this?

scrollpane borders

@DevCharly
Copy link
Collaborator

I've seen the four sides of a ScrollPane border painted with different thicknesses at large scalings: 125% ~ 175%.

This is because Swing scales the 1px border either to one or to two screen pixels.

Any idea that we can work around this?

Not really...

@eirikbakke
Copy link
Contributor

I use a special Border implementation that avoids this problem (e.g. on 150% scaling on Windows). Feel very free to adopt it into FlatLAF; the source code is already in the NetBeans IDE repo under the Apache license:

https://github.com/apache/netbeans/blob/master/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/DPISafeBorder.java

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

No branches or pull requests

3 participants