Skip to content

Commit

Permalink
wxGUI: fix animation/nviz animation tool play/record animation (#3586)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Apr 12, 2024
1 parent 7e2e724 commit 6e716d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions gui/wxpython/animation/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/nviz/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/nviz/mapwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,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)

Expand Down Expand Up @@ -713,7 +713,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()
Expand Down

0 comments on commit 6e716d6

Please sign in to comment.