Remove extra vertical padding

This commit is contained in:
drdev
2014-07-28 01:49:08 +00:00
parent 59bb321593
commit 425ebeadeb
2 changed files with 6 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ public class ImageCache {
} }
image = null; image = null;
} }
catch (final InvalidCacheLoadException ex) { catch (final Exception ex) {
image = null; image = null;
} }

View File

@@ -175,12 +175,11 @@ public class CardImageRenderer {
} }
renderer.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h); renderer.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
float padX = TEXT_FONT.getCapHeight() * 0.75f; float padding = TEXT_FONT.getCapHeight() * 0.75f;
float padY = padX + 2; //add a little more vertical padding x += padding;
x += padX; y += padding;
y += padY; w -= 2 * padding;
w -= 2 * padX; h -= 2 * padding;
h -= 2 * padY;
String text = card.getRules().getOracleText(); String text = card.getRules().getOracleText();
text = text.replace("\\n", "\n"); //replace new line placeholders with actual new line characters text = text.replace("\\n", "\n"); //replace new line placeholders with actual new line characters
cardTextRenderer.drawText(renderer, text, TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, HAlignment.LEFT, true); cardTextRenderer.drawText(renderer, text, TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, HAlignment.LEFT, true);