fix: extended support for getBorderArc method

Fixes `FlatUIUtils.getBorderArc()` returning `0` for `FlatLineBorder`, causing background overflow outside rounded corners when a background color is set.
This commit is contained in:
Dar
2025-03-21 09:12:24 +01:00
parent d8e59f2cf3
commit dcb4c09387

View File

@@ -461,9 +461,13 @@ public class FlatUIUtils
* Returns the scaled arc diameter of the border for the given component. * Returns the scaled arc diameter of the border for the given component.
*/ */
public static float getBorderArc( JComponent c ) { public static float getBorderArc( JComponent c ) {
FlatBorder border = getOutsideFlatBorder( c ); Border border = c.getBorder();
return (border != null) if( border instanceof FlatLineBorder )
? UIScale.scale( (float) border.getArc( c ) ) return UIScale.scale( ((FlatLineBorder)border).getArc() );
FlatBorder outsideBorder = getOutsideFlatBorder( c );
return (outsideBorder != null)
? UIScale.scale( (float) outsideBorder.getArc( c ) )
: 0; : 0;
} }