Fix repainting when the path is drawn
ui: * Fix repainting when the path is supposed to be drawn. At any repainting (window resizing, menu unfolding), the maze was repainted without the shortest path. We now use the attribute stored in the model to know whether the path should be drawn or not when we repaint the panel (see #24)
This commit is contained in:
1 parent
7242872b83
commit
11200ebed2
1 file changed
+3
@@ -32,6 +32,9 @@ public class MazeDrawing extends JPanel {
|
||||
int height = getHeight();
|
||||
|
||||
mazeApp.getMazeAppModel().paintMaze(g2d, width, height);
|
||||
if (mazeApp.getMazeAppModel().isPathDrawn()) {
|
||||
paintShortestPath(g2d, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyForUpdates(Object param) {
|
||||
|
||||
Reference in new issue
Block a user