FlatLaf icon indicating copy to clipboard operation
FlatLaf copied to clipboard

ScrollPane border paint problem at large scalings

Open tristanzhou opened this issue 2 years ago • 2 comments

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

tristanzhou avatar Oct 05 '23 01:10 tristanzhou

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...

DevCharly avatar Oct 22 '23 16:10 DevCharly

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

eirikbakke avatar Dec 06 '23 20:12 eirikbakke

Fixed in latest 3.5-SNAPSHOT: https://github.com/JFormDesigner/

The scrollpane border now has same thickness on all 4 sides.

DevCharly avatar Jun 14 '24 17:06 DevCharly