From 11200ebed29760b5601cb35a4384c5920d808b79 Mon Sep 17 00:00:00 2001 From: "Sylvain Rager (regar42)" Date: Tue, 26 Dec 2017 22:16:40 +0100 Subject: [PATCH] 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) --- src/ui/MazeDrawing.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/MazeDrawing.java b/src/ui/MazeDrawing.java index b5ca367..32874f0 100644 --- a/src/ui/MazeDrawing.java +++ b/src/ui/MazeDrawing.java @@ -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) {