mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-27 03:46:17 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user