From 73aadd72c70f7d51803cd8ae742cae25e6c97c4a Mon Sep 17 00:00:00 2001 From: Tomas Zigo <50632337+tmszi@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:49:16 +0200 Subject: [PATCH] wxGUI: fix animation/nviz animation tool play/record animation (#3586) --- gui/wxpython/animation/controller.py | 6 +++--- gui/wxpython/nviz/animation.py | 2 +- gui/wxpython/nviz/mapwindow.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gui/wxpython/animation/controller.py b/gui/wxpython/animation/controller.py index 21c76e428dc..d6488d53263 100644 --- a/gui/wxpython/animation/controller.py +++ b/gui/wxpython/animation/controller.py @@ -92,7 +92,7 @@ def SetTimeTick(self, value): self._timeTick = value if self.timer.IsRunning(): self.timer.Stop() - self.timer.Start(self._timeTick) + self.timer.Start(int(self._timeTick)) self.DisableSliderIfNeeded() timeTick = property(fget=GetTimeTick, fset=SetTimeTick) @@ -110,7 +110,7 @@ def StartAnimation(self): anim.NextFrameIndex() anim.Start() if not self.timer.IsRunning(): - self.timer.Start(self.timeTick) + self.timer.Start(int(self.timeTick)) self.DisableSliderIfNeeded() def PauseAnimation(self, paused): @@ -120,7 +120,7 @@ def PauseAnimation(self, paused): self.DisableSliderIfNeeded() else: if not self.timer.IsRunning(): - self.timer.Start(self.timeTick) + self.timer.Start(int(self.timeTick)) self.DisableSliderIfNeeded() for anim in self.animations: diff --git a/gui/wxpython/nviz/animation.py b/gui/wxpython/nviz/animation.py index 22b243d3efa..1eeb8d1aea8 100644 --- a/gui/wxpython/nviz/animation.py +++ b/gui/wxpython/nviz/animation.py @@ -59,7 +59,7 @@ def __init__(self, mapWindow, timer): def Start(self): """Start recording/playing""" - self.timer.Start(self.GetInterval()) + self.timer.Start(int(self.GetInterval())) def Pause(self): """Pause recording/playing""" diff --git a/gui/wxpython/nviz/mapwindow.py b/gui/wxpython/nviz/mapwindow.py index 2ad734747f6..1c291e1068b 100644 --- a/gui/wxpython/nviz/mapwindow.py +++ b/gui/wxpython/nviz/mapwindow.py @@ -564,7 +564,7 @@ def OnKeyDown(self, event): self.fly["pos"]["x"] = sx / 2 self.fly["pos"]["y"] = sy / 2 self.fly["mouseControl"] = False # controlled by keyboard - self.timerFly.Start(self.fly["interval"]) + self.timerFly.Start(int(self.fly["interval"])) self.ProcessFlyByArrows(keyCode=key) @@ -712,7 +712,7 @@ def OnLeftDown(self, event): if self.mouse["use"] == "fly": if not self.timerFly.IsRunning(): - self.timerFly.Start(self.fly["interval"]) + self.timerFly.Start(int(self.fly["interval"])) self.fly["mouseControl"] = True event.Skip()