FlatBorder: fixed wrong round edge of focused components in themes without outer focus border (Flat Light/Dark)

This commit is contained in:
Karl Tauber
2021-02-01 01:30:52 +01:00
parent 7f8f3aa99b
commit 02f7cd77f4
2 changed files with 6 additions and 4 deletions

View File

@@ -97,10 +97,12 @@ public class FlatBorder
? (outlineColor != null ? innerOutlineWidth : getInnerFocusWidth( c )) ? (outlineColor != null ? innerOutlineWidth : getInnerFocusWidth( c ))
: 0; : 0;
if( focusWidth > 0 || innerWidth > 0 ) {
g2.setColor( (outlineColor != null) ? outlineColor : getFocusColor( c ) ); g2.setColor( (outlineColor != null) ? outlineColor : getFocusColor( c ) );
FlatUIUtils.paintComponentOuterBorder( g2, x, y, width, height, FlatUIUtils.paintComponentOuterBorder( g2, x, y, width, height,
focusWidth, borderWidth + scale( innerWidth ), arc ); focusWidth, borderWidth + scale( innerWidth ), arc );
} }
}
// paint border // paint border
g2.setPaint( (outlineColor != null) ? outlineColor : getBorderColor( c ) ); g2.setPaint( (outlineColor != null) ? outlineColor : getBorderColor( c ) );

View File

@@ -345,7 +345,7 @@ public class FlatUIUtils
float innerArc = arc - (lineWidth * 2); float innerArc = arc - (lineWidth * 2);
// reduce outer arc slightly for small arcs to make the curve slightly wider // reduce outer arc slightly for small arcs to make the curve slightly wider
if( arc > 0 && arc < UIScale.scale( 10 ) ) if( focusWidth > 0 && arc > 0 && arc < UIScale.scale( 10 ) )
outerArc -= UIScale.scale( 2f ); outerArc -= UIScale.scale( 2f );
Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD );