cleanup: use max

GitOrigin-RevId: 514f93308e81f93afbf31224bdeb4bf97b315ac9
This commit is contained in:
Sergey Ignatov
2020-01-13 21:32:07 +00:00
committed by intellij-monorepo-bot
parent 16e7df49a1
commit 081f7bcb3a
@@ -34,7 +34,6 @@ import static javax.swing.SwingConstants.LEFT;
import static javax.swing.SwingUtilities.layoutCompoundLabel;
public class SeparatorWithText extends JComponent implements Accessible {
private String myCaption;
private int myPrefWidth;
private int myAlignment;
@@ -74,7 +73,7 @@ public class SeparatorWithText extends JComponent implements Accessible {
}
private Dimension getPreferredFontSize() {
Dimension size = new Dimension(myPrefWidth < 0 ? 0 : myPrefWidth, 1);
Dimension size = new Dimension(Math.max(myPrefWidth, 0), 1);
String caption = getCaption();
if (caption != null) {
FontMetrics fm = getFontMetrics(getFont());