diff --git a/examples/demo.py b/examples/demo.py index 1e4a14d3ba6880b904403642bde7a3a3bf4115a2..fa897713e1987082ffecf1b1bc824d1329c44342 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -164,13 +164,7 @@ class Demo: demo_001 = Demo(Scenario_Generator.load_scenario('complex_scene.pkl')) demo_001.set_record_frames(os.path.join(__file_dirname__, '..', 'rendering', 'frame_{:04d}.bmp')) demo_001.run_demo(120) - - @staticmethod - def run_complex_scene_2(): - demo_001 = Demo(Scenario_Generator.load_scenario('complex_scene_2.pkl')) - demo_001.set_record_frames(os.path.join(__file_dirname__, '..', 'rendering', 'frame_{:04d}.bmp')) - demo_001.run_demo(120) + if __name__ == "__main__": Demo.run_complex_scene() - Demo.run_complex_scene_2() diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py index 4dcd4ef248f3405678f5d600068b48c52d4cccdb..081cf02c804f5a8d64542b2cfdc75c664bc479a9 100644 --- a/flatland/utils/editor.py +++ b/flatland/utils/editor.py @@ -277,6 +277,7 @@ class Controller(object): # If the mouse is held down, enqueue an event in our own queue # The intention was to avoid too many redraws. + # Reset the lrcStroke list, if ALT, CTRL or SHIFT pressed if event["buttons"] > 0: qEvents.append((time.time(), x, y)) bShift = event["shiftKey"] @@ -299,7 +300,6 @@ class Controller(object): return else: self.lrcStroke = [] - if self.model.iSelectedAgent is not None: self.lrcStroke = [] @@ -328,7 +328,6 @@ class Controller(object): else: self.model.mod_path(not event["shiftKey"]) - def refresh(self, event): self.debug("refresh") self.view.redraw() diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index e3e32125e32f0b7f0028fcbe9962b21ffbdc591c..23f8b8790a44be3d4835a1a9594effaa1ee33164 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -439,7 +439,7 @@ class PILSVG(PILGL): elif (self.background_grid[col][row] > 4) or ((col ** 3 + row ** 2 + col * row) % 10 == 0): a = int(self.background_grid[col][row]) - 4 a = (a + (col + row + col * row + col ** 3 + row ** 4)) % len(self.dScenery) - if (col + row + col * row ) % 10 > 2: + if (col + row + col * row) % 10 > 2: a = 0 pilTrack = self.dScenery[a]