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.
*/
public static float getBorderArc( JComponent c ) {
FlatBorder border = getOutsideFlatBorder( c );
return (border != null)
? UIScale.scale( (float) border.getArc( c ) )
Border border = c.getBorder();
if( border instanceof FlatLineBorder )
return UIScale.scale( ((FlatLineBorder)border).getArc() );
FlatBorder outsideBorder = getOutsideFlatBorder( c );
return (outsideBorder != null)
? UIScale.scale( (float) outsideBorder.getArc( c ) )
: 0;
}