slightly offcenter

This commit is contained in:
spjspj 2018-03-01 00:32:30 +11:00
parent 596ca5be86
commit 8887cca387
2 changed files with 22 additions and 22 deletions

View file

@ -51,7 +51,7 @@ public final class CardRendererUtils {
// Return the buffered image // Return the buffered image
return bimage; return bimage;
} }
public static Color abitbrighter(Color c) { public static Color abitbrighter(Color c) {
int r = c.getRed(); int r = c.getRed();
int g = c.getGreen(); int g = c.getGreen();
@ -107,7 +107,7 @@ public final class CardRendererUtils {
g.setColor(abitdarker(g.getColor())); g.setColor(abitdarker(g.getColor()));
g.drawLine(x + 1 + bevel, y + h - 2, x + 1 + bevel + w - 2 * bevel - 2, y + h - 2); g.drawLine(x + 1 + bevel, y + h - 2, x + 1 + bevel + w - 2 * bevel - 2, y + h - 2);
} }
public static void drawZendikarLandBox(Graphics2D g, int x, int y, int w, int h, int bevel, Paint border, Paint fill) { public static void drawZendikarLandBox(Graphics2D g, int x, int y, int w, int h, int bevel, Paint border, Paint fill) {
g.setColor(new Color(0, 0, 0, 150)); g.setColor(new Color(0, 0, 0, 150));
@ -117,25 +117,24 @@ public final class CardRendererUtils {
g.drawOval(x + w - bevel * 2, y, bevel * 2 - 1, h - 1); g.drawOval(x + w - bevel * 2, y, bevel * 2 - 1, h - 1);
g.drawOval(x + 1, y + 1, bevel * 2 - 3, h - 3); g.drawOval(x + 1, y + 1, bevel * 2 - 3, h - 3);
g.drawOval(x + 1 + w - bevel * 2, y + 1, bevel * 2 - 3, h - 3); g.drawOval(x + 1 + w - bevel * 2, y + 1, bevel * 2 - 3, h - 3);
// The big circle in the middle.. (diameter=2+1/4 of height) - 3/4 above line, 1/2 below 0.75 + .5 + 1= 2.25 = 9/4 // The big circle in the middle.. (diameter=2+1/4 of height) - 3/4 above line, 1/2 below 0.75 + .5 + 1= 2.25 = 9/4
g.drawOval(x + w / 2 - h - h/8, y - 3*h/4, 9*h/4, 9*h/4); g.drawOval(x + w / 2 - h - h / 8, y - 3 * h / 4, 9 * h / 4, 9 * h / 4);
g.drawRect(x + bevel, y, w - 2 * bevel, h - 1); g.drawRect(x + bevel, y, w - 2 * bevel, h - 1);
g.drawRect(x + 1 + bevel, y + 1, w - 2 * bevel - 2, h - 3); g.drawRect(x + 1 + bevel, y + 1, w - 2 * bevel - 2, h - 3);
g.setPaint(fill); g.setPaint(fill);
g.setPaint(fill);
g.setColor(abitbrighter(g.getColor())); g.setColor(abitbrighter(g.getColor()));
g.drawLine(x + 1 + bevel, y + 1, x + 1 + bevel + w - 2 * bevel - 2, y + 1); g.drawLine(x + 1 + bevel, y + 1, x + 1 + bevel + w - 2 * bevel - 2, y + 1);
g.setPaint(fill); g.setPaint(fill);
g.setColor(abitdarker(g.getColor())); g.setColor(abitdarker(g.getColor()));
g.drawLine(x + 1 + bevel, y + h - 2, x + 1 + bevel + w - 2 * bevel - 2, y + h - 2); g.drawLine(x + 1 + bevel, y + h - 2, x + 1 + bevel + w - 2 * bevel - 2, y + h - 2);
g.fillOval(x + 2, y + 2, bevel * 2 - 4, h - 4); g.fillOval(x + 2, y + 2, bevel * 2 - 4, h - 4);
g.fillOval(x + 2 + w - bevel * 2, y + 2, bevel * 2 - 4, h - 4); g.fillOval(x + 2 + w - bevel * 2, y + 2, bevel * 2 - 4, h - 4);
g.fillRect(x + bevel, y + 2, w - 2 * bevel, h - 4); g.fillRect(x + bevel, y + 2, w - 2 * bevel, h - 4);
g.fillOval(x + w / 2 - h - h/8, y - 3*h/4, 9*h/4, 9*h/4); g.fillOval(x + w / 2 - h - h / 8, y - 3 * h / 4, 9 * h / 4, 9 * h / 4);
} }
// Get the width of a mana cost rendered with ManaSymbols.draw // Get the width of a mana cost rendered with ManaSymbols.draw

View file

@ -332,7 +332,7 @@ public class ModernCardRenderer extends CardRenderer {
return TYPE_LINE_Y_FRAC; return TYPE_LINE_Y_FRAC;
} }
} }
private boolean isZendikarFullArtLand() { private boolean isZendikarFullArtLand() {
return cardView.getFrameStyle() == FrameStyle.BFZ_FULL_ART_BASIC || cardView.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC; return cardView.getFrameStyle() == FrameStyle.BFZ_FULL_ART_BASIC || cardView.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC;
} }
@ -525,7 +525,7 @@ public class ModernCardRenderer extends CardRenderer {
} else { } else {
int x = totalContentInset; int x = totalContentInset;
int y = typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset; int y = typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset;
int w = contentWidth - 2; int w = contentWidth;
int h = boxHeight - 4; int h = boxHeight - 4;
CardRendererUtils.drawZendikarLandBox(g, CardRendererUtils.drawZendikarLandBox(g,
@ -558,7 +558,7 @@ public class ModernCardRenderer extends CardRenderer {
int topxdelta = 45 * contentWidth / 1000; int topxdelta = 45 * contentWidth / 1000;
int endydelta = 60 * (totalContentInset + y2) / 265; int endydelta = 60 * (totalContentInset + y2) / 265;
int x2 = x + contentWidth; int x2 = x + contentWidth;
// Curve ends at 60 out of 265 // Curve ends at 60 out of 265
drawBFZCurvedFace(g, image, x, yb, x2, y2, drawBFZCurvedFace(g, image, x, yb, x2, y2,
topxdelta, endydelta, topxdelta, endydelta,
@ -628,8 +628,8 @@ public class ModernCardRenderer extends CardRenderer {
//curve.transform(AffineTransform.getTranslateInstance(-1,-1)); //curve.transform(AffineTransform.getTranslateInstance(-1,-1));
g2.draw(innercurve); g2.draw(innercurve);
} }
public void drawBFZCurvedFace(Graphics2D g2, BufferedImage image, int x, int y, int x2, int y2, public void drawBFZCurvedFace(Graphics2D g2, BufferedImage image, int x, int y, int x2, int y2,
int topxdelta, int endydelta, int topxdelta, int endydelta,
Color boxColor, Paint paint) { Color boxColor, Paint paint) {
BufferedImage artToUse = faceArtImage; BufferedImage artToUse = faceArtImage;
@ -663,13 +663,13 @@ public class ModernCardRenderer extends CardRenderer {
curve.lineTo(x + topxdelta, y); curve.lineTo(x + topxdelta, y);
Path2D.Double innercurve = new Path2D.Double(); Path2D.Double innercurve = new Path2D.Double();
innercurve.moveTo(x + topxdelta, y+1); innercurve.moveTo(x + topxdelta, y + 1);
innercurve.quadTo(x+1, y + endydelta / 2, x+1, y + endydelta); innercurve.quadTo(x + 1, y + endydelta / 2, x + 1, y + endydelta);
innercurve.lineTo(x+1, y2-1); innercurve.lineTo(x + 1, y2 - 1);
innercurve.lineTo(x2-1, y2-1); innercurve.lineTo(x2 - 1, y2 - 1);
innercurve.lineTo(x2-1, y + endydelta); innercurve.lineTo(x2 - 1, y + endydelta);
innercurve.quadTo(x2-1, y + endydelta / 2, x2 - topxdelta, y+1); innercurve.quadTo(x2 - 1, y + endydelta / 2, x2 - topxdelta, y + 1);
innercurve.lineTo(x + topxdelta, y+1); innercurve.lineTo(x + topxdelta, y + 1);
Rectangle2D r = curve.getBounds2D(); Rectangle2D r = curve.getBounds2D();
int minX = (int) r.getX(); int minX = (int) r.getX();
@ -969,7 +969,8 @@ public class ModernCardRenderer extends CardRenderer {
} else // Big circle in the middle for Zendikar lands } else // Big circle in the middle for Zendikar lands
{ {
if (allRules.size() == 1) { if (allRules.size() == 1) {
drawBasicManaSymbol(g, x + w / 2 - h - h / 8, y - 3 * h / 4, 9 * h / 4, 9 * h / 4, ((TextboxBasicManaRule) allRules.get(0)).getBasicManaSymbol()); // Size of mana symbol = 9/4 * h, 3/4h above line
drawBasicManaSymbol(g, x + w / 2 - 9 * h / 8 + 1, y - 3 * h / 4, 9 * h / 4, 9 * h / 4, ((TextboxBasicManaRule) allRules.get(0)).getBasicManaSymbol());
return; return;
} else { } else {
if (allRules.size() > 1) { if (allRules.size() > 1) {