mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
Button and ToggleButton: Threat Unicode surrogate character pair as single character and make button square (issue #234)
This commit is contained in:
@@ -251,7 +251,10 @@ public class FlatButtonUI
|
||||
Icon icon = ((AbstractButton)c).getIcon();
|
||||
String text = ((AbstractButton)c).getText();
|
||||
return (icon != null && (text == null || text.isEmpty())) ||
|
||||
(icon == null && text != null && ("...".equals( text ) || text.length() == 1));
|
||||
(icon == null && text != null &&
|
||||
("...".equals( text ) ||
|
||||
text.length() == 1 ||
|
||||
(text.length() == 2 && Character.isSurrogatePair( text.charAt( 0 ), text.charAt( 1 ) ))));
|
||||
}
|
||||
|
||||
static final int TYPE_OTHER = -1;
|
||||
|
||||
Reference in New Issue
Block a user