From d5bd683ffd5cdb58fc806895c6fd409570f8a330 Mon Sep 17 00:00:00 2001
From: hagrid67 <jdhwatson@gmail.com>
Date: Wed, 29 May 2019 00:02:02 +0100
Subject: [PATCH] got editor mostly working with PILSVG

---
 flatland/utils/editor.py      | 3 +--
 flatland/utils/rendertools.py | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py
index 7c9e0687..1f4a6047 100644
--- a/flatland/utils/editor.py
+++ b/flatland/utils/editor.py
@@ -174,10 +174,9 @@ class View(object):
         self.oRT = rt.RenderTool(self.editor.env, gl=self.sGL)
 
     def redraw(self):
-        # TODO: bit of a hack - can we suppress the console messages from MPL at source?
-        # with redirect_stdout(stdout_dest):
         with self.wOutput:
             # plt.figure(figsize=(10, 10))
+            self.oRT.set_new_rail()
             self.oRT.renderEnv(spacing=False, arrows=False, sRailColor="gray",
                                show=False, iSelectedAgent=self.model.iSelectedAgent,
                                show_observations=self.show_observations())
diff --git a/flatland/utils/rendertools.py b/flatland/utils/rendertools.py
index 15b5774c..aa8731b1 100644
--- a/flatland/utils/rendertools.py
+++ b/flatland/utils/rendertools.py
@@ -758,7 +758,7 @@ class RenderTool(object):
             for iAgent, agent in enumerate(self.env.agents_static):
                 if agent is None:
                     continue
-                dTargets[agent.target] = iAgent
+                dTargets[tuple(agent.target)] = iAgent
 
             # Draw each cell independently
             for r in range(env.height):
-- 
GitLab