Commit 11c61563 by Antti Tonkyra

Aspect ratio should be a constant value here

1 parent 3b7655ce
......@@ -66,8 +66,7 @@ public class CardPrintBean implements CardPrintBeanLocal {
private PrintedCardFacade printedCardFacade;
private static final Logger logger = LoggerFactory.getLogger(CardPrintBean.class);
private int nick_x = 0;
private int nick_y = 0;
public static final double ASPECT_RATIO = 0.7317073170731707;
/**
* Default constructor.
......@@ -144,11 +143,11 @@ public class CardPrintBean implements CardPrintBeanLocal {
int originalHeight = faceBufferedImage.getHeight();
int width = originalWidth;
int height = (int) Math.round(originalWidth * (1 / 0.7317073170731707));
int height = (int) Math.round(originalWidth * (1 / ASPECT_RATIO));
if (height > originalHeight) {
height = originalHeight;
width = (int) Math.round(originalHeight * 0.7317073170731707);
width = (int) Math.round(originalHeight * ASPECT_RATIO);
}
int offsetx = (originalWidth - width) / 2;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!