Merge pull request #2101 from sethtroll/removeoppinfopadding

opponent info: reduce padding size
This commit is contained in:
Tomas Slusny
2018-05-02 20:37:50 +02:00
committed by GitHub

View File

@@ -51,10 +51,9 @@ class OpponentInfoOverlay extends Overlay
{ {
private static final int WIDTH = 129; private static final int WIDTH = 129;
private static final int TOP_BORDER = 4; private static final int TOP_BORDER = 2;
private static final int BOTTOM_BORDER = 4;
private static final int BAR_WIDTH = WIDTH - 10; private static final int BAR_WIDTH = WIDTH - 4;
private static final int BAR_HEIGHT = 16; private static final int BAR_HEIGHT = 16;
private static final Color HP_GREEN = new Color(0, 146, 54, 230); private static final Color HP_GREEN = new Color(0, 146, 54, 230);
@@ -146,14 +145,12 @@ class OpponentInfoOverlay extends Overlay
int height = TOP_BORDER + fm.getHeight(); // opponent name int height = TOP_BORDER + fm.getHeight(); // opponent name
if (lastRatio >= 0) if (lastRatio >= 0)
{ {
height += BAR_HEIGHT + 6; height += BAR_HEIGHT + 5;
} }
if (opponentsOpponentName != null) if (opponentsOpponentName != null)
{ {
height += fm.getHeight() + 3; height += fm.getHeight() + 5;
} }
height += 3;
height += BOTTOM_BORDER;
final BackgroundComponent backgroundComponent = new BackgroundComponent(); final BackgroundComponent backgroundComponent = new BackgroundComponent();
backgroundComponent.setRectangle(new Rectangle(0, 0, WIDTH, height)); backgroundComponent.setRectangle(new Rectangle(0, 0, WIDTH, height));
@@ -174,7 +171,6 @@ class OpponentInfoOverlay extends Overlay
if (lastRatio >= 0) if (lastRatio >= 0)
{ {
int barWidth = (int) (lastRatio * (float) BAR_WIDTH); int barWidth = (int) (lastRatio * (float) BAR_WIDTH);
y += 3;
graphics.setColor(HP_GREEN); graphics.setColor(HP_GREEN);
graphics.fillRect((WIDTH - BAR_WIDTH) / 2, y, barWidth, BAR_HEIGHT); graphics.fillRect((WIDTH - BAR_WIDTH) / 2, y, barWidth, BAR_HEIGHT);