mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -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.
|
* 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user