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:
regar42 committed 2017-12-26 22:16:40 +01:00
1 parent 7242872b83
commit 11200ebed2
1 file changed
+3
+3
View File
@@ -32,6 +32,9 @@ public class MazeDrawing extends JPanel {
int height = getHeight(); int height = getHeight();
mazeApp.getMazeAppModel().paintMaze(g2d, width, height); mazeApp.getMazeAppModel().paintMaze(g2d, width, height);
if (mazeApp.getMazeAppModel().isPathDrawn()) {
paintShortestPath(g2d, width, height);
}
} }
public void notifyForUpdates(Object param) { public void notifyForUpdates(Object param) {