TextField: avoid garbage in corners if TextComponent.arc is set to a large value

This commit is contained in:
Karl Tauber
2020-05-12 18:58:17 +02:00
parent 070c435f40
commit 659ead903c
4 changed files with 151 additions and 6 deletions

View File

@@ -96,7 +96,7 @@ public class FlatPasswordFieldUI
placeholderForeground = UIManager.getColor( prefix + ".placeholderForeground" );
capsLockIcon = UIManager.getIcon( "PasswordField.capsLockIcon" );
LookAndFeel.installProperty( getComponent(), "opaque", focusWidth == 0 );
LookAndFeel.installProperty( getComponent(), "opaque", false );
MigLayoutVisualPadding.install( getComponent(), focusWidth );
}

View File

@@ -95,7 +95,7 @@ public class FlatTextFieldUI
isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" );
placeholderForeground = UIManager.getColor( prefix + ".placeholderForeground" );
LookAndFeel.installProperty( getComponent(), "opaque", focusWidth == 0 );
LookAndFeel.installProperty( getComponent(), "opaque", false );
MigLayoutVisualPadding.install( getComponent(), focusWidth );
}
@@ -162,7 +162,7 @@ public class FlatTextFieldUI
return;
// fill background if opaque to avoid garbage if user sets opaque to true
if( c.isOpaque() && focusWidth > 0 )
if( c.isOpaque() && (focusWidth > 0 || arc > 0) )
FlatUIUtils.paintParentBackground( g, c );
// paint background