Skip to content
This repository has been archived by the owner on Dec 4, 2021. It is now read-only.

Commit

Permalink
Corrige un bug dans la date
Browse files Browse the repository at this point in the history
Le choix de la meilleur date après le calcul n'était pas optimal
On pouvait se retrouver avec une date trop petite car plus haute
  • Loading branch information
NicolasGrosjean committed Apr 15, 2015
1 parent faad05f commit ff12cf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/biggest_states/Biggest_Pixel.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ public void run() {
Writing resWriting = new Writing();
resWriting.calculateWriting(p, dateTab, map, Math.max(3 * maxTextSize / 4, 21), true,
leftDate, fontName);
if (resWriting.getTextOriginSolutionYOfLowerWord() < seaW.getTextOriginSolutionYOfLowerWord()) {
// Keep the best combination
if (resWriting.getUnVerifiedTextSize() > 20) {
// Keep the first good combination because it is ordered by decreasing y
seaW = new Writing(resWriting);
break;
}
}
if (seaW.getTextOriginSolution() != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/textWriting/Writing.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ public void calculateWriting(PriorityQueue<Line> block, String[] textToWrite,
calculateTextOrigin(textToWrite, g2d, frc);
} else if (solutionNumber == 0) {
// textOrigin[0] is the better choice at this moment
if (!date || !leftDate || textOriginSolution != null &&
textOriginSolution[0].y > textOrigin[0].y) {
if (!date || !leftDate || (textOriginSolution != null &&
textOriginSolution[0].y > textOrigin[0].y)) {
// For a date in left, we save only if it is higher
// Else always save
saveSolution();
Expand Down

0 comments on commit ff12cf5

Please sign in to comment.