IDEA-161384 ui: fix text alignment in ComboBoxAction under HiDPI

This commit is contained in:
Aleksey Pivovarov
2016-09-26 16:49:26 +03:00
committed by Aleksey Pivovarov
parent 64004fc7c5
commit 136bb52aae
@@ -415,7 +415,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
final Font font = getFont();
g.setFont(font);
g.setColor(textColor);
g.drawString(getText(), x, (size.height + font.getSize()) / 2 - 1);
UIUtil.drawCenteredString((Graphics2D)g, new Rectangle(x, 0, Integer.MAX_VALUE, size.height), getText(), false, true);
}
}
else {
@@ -454,7 +454,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
final Font font = getFont();
g2.setFont(font);
g2.setColor(textColor);
g2.drawString(getText(), x, (size.height + font.getSize()) / 2 - 1);
UIUtil.drawCenteredString(g2, new Rectangle(x, 0, Integer.MAX_VALUE, size.height), getText(), false, true);
}
}
else {