From 2a8b24f96338571be69c01d5c278104c52cba83c Mon Sep 17 00:00:00 2001 From: Eric Vin Date: Wed, 30 Oct 2024 09:16:08 -0700 Subject: [PATCH] Moved scenicToScreenVal int cast. --- src/scenic/simulators/newtonian/simulator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scenic/simulators/newtonian/simulator.py b/src/scenic/simulators/newtonian/simulator.py index a4c0d6b2a..80db561d0 100644 --- a/src/scenic/simulators/newtonian/simulator.py +++ b/src/scenic/simulators/newtonian/simulator.py @@ -170,13 +170,13 @@ def addRegion(region, color, width=1): def scenicToScreenVal(self, pos): x, y = pos[:2] - screen_x = int((x - self.min_x) * self.screenScaling) - screen_y = HEIGHT - 1 - int((y - self.min_y) * self.screenScaling) + screen_x = (x - self.min_x) * self.screenScaling + screen_y = HEIGHT - 1 - (y - self.min_y) * self.screenScaling screen_x = screen_x + self.screenTranslation[0] screen_y = screen_y + self.screenTranslation[1] - return screen_x, screen_y + return int(screen_x), int(screen_y) def createObjectInSimulator(self, obj): # Set actor's initial speed