fix resolved path drawing after background
- resolved path should be dran after background, else it is not visible.
This commit is contained in:
@@ -303,28 +303,6 @@ public class MazeComponent
|
|||||||
mY = map.getHeight();
|
mY = map.getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sX == gX) && (sY == gY)) {
|
|
||||||
g.setColor(colorMap.goal);
|
|
||||||
} else {
|
|
||||||
g.setColor(colorMap.resolved_path);
|
|
||||||
cp.drawDot(g, new Position(gX, gY), pX, pY, mX, mY);
|
|
||||||
g.setColor(colorMap.path);
|
|
||||||
}
|
|
||||||
cp.drawDot(g, new Position(sX, sY), pX, pY, mX, mY);
|
|
||||||
|
|
||||||
synchronized (lockChange) {
|
|
||||||
g.setColor(colorMap.goal);
|
|
||||||
if (current != null) {
|
|
||||||
cp.drawDot(g, current, pX, pY, mX, mY);
|
|
||||||
}
|
|
||||||
if (solvedPath != null) {
|
|
||||||
for (DirectionPosition resolved : solvedPath) {
|
|
||||||
// cp.drawDot(g, resolved.getPosition(), pX, pY, mX, mY);
|
|
||||||
cp.drawPath(g, resolved, pX, pY, mX, mY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int aX = pX;
|
int aX = pX;
|
||||||
int aY = pY;
|
int aY = pY;
|
||||||
|
|
||||||
@@ -344,6 +322,16 @@ public class MazeComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((sX == gX) && (sY == gY)) {
|
||||||
|
g.setColor(colorMap.goal);
|
||||||
|
} else {
|
||||||
|
g.setColor(colorMap.resolved_path);
|
||||||
|
cp.drawDot(g, new Position(gX, gY), pX, pY, mX, mY);
|
||||||
|
g.setColor(colorMap.path);
|
||||||
|
}
|
||||||
|
cp.drawDot(g, new Position(sX, sY), pX, pY, mX, mY);
|
||||||
|
|
||||||
|
pX = aX;
|
||||||
pY = aY;
|
pY = aY;
|
||||||
|
|
||||||
// draw all walls within clip bounds horiz first then lines
|
// draw all walls within clip bounds horiz first then lines
|
||||||
@@ -355,6 +343,22 @@ public class MazeComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pX = aX;
|
||||||
|
pY = aY;
|
||||||
|
|
||||||
|
synchronized (lockChange) {
|
||||||
|
g.setColor(colorMap.goal);
|
||||||
|
if (current != null) {
|
||||||
|
cp.drawDot(g, current, pX, pY, mX, mY);
|
||||||
|
}
|
||||||
|
if (solvedPath != null) {
|
||||||
|
for (DirectionPosition resolved : solvedPath) {
|
||||||
|
// cp.drawDot(g, resolved.getPosition(), pX, pY, mX, mY);
|
||||||
|
cp.drawPath(g, resolved, pX, pY, mX, mY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.showAll) {
|
if (this.showAll) {
|
||||||
statusListener.addStatus("*");
|
statusListener.addStatus("*");
|
||||||
pX = aX;
|
pX = aX;
|
||||||
|
|||||||
Reference in New Issue
Block a user