Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 11c61563
authored
Feb 14, 2014
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Aspect ratio should be a constant value here
1 parent
3b7655ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
View file @
11c6156
...
@@ -66,8 +66,7 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -66,8 +66,7 @@ public class CardPrintBean implements CardPrintBeanLocal {
private
PrintedCardFacade
printedCardFacade
;
private
PrintedCardFacade
printedCardFacade
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CardPrintBean
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CardPrintBean
.
class
);
private
int
nick_x
=
0
;
public
static
final
double
ASPECT_RATIO
=
0.7317073170731707
;
private
int
nick_y
=
0
;
/**
/**
* Default constructor.
* Default constructor.
...
@@ -144,11 +143,11 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -144,11 +143,11 @@ public class CardPrintBean implements CardPrintBeanLocal {
int
originalHeight
=
faceBufferedImage
.
getHeight
();
int
originalHeight
=
faceBufferedImage
.
getHeight
();
int
width
=
originalWidth
;
int
width
=
originalWidth
;
int
height
=
(
int
)
Math
.
round
(
originalWidth
*
(
1
/
0.7317073170731707
));
int
height
=
(
int
)
Math
.
round
(
originalWidth
*
(
1
/
ASPECT_RATIO
));
if
(
height
>
originalHeight
)
{
if
(
height
>
originalHeight
)
{
height
=
originalHeight
;
height
=
originalHeight
;
width
=
(
int
)
Math
.
round
(
originalHeight
*
0.7317073170731707
);
width
=
(
int
)
Math
.
round
(
originalHeight
*
ASPECT_RATIO
);
}
}
int
offsetx
=
(
originalWidth
-
width
)
/
2
;
int
offsetx
=
(
originalWidth
-
width
)
/
2
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment