X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b5403c8d65be699529995d221c3119f1da353c8..0944fceb987def04dc89d03d58c35793d0ecdfed:/contrib/src/animate/animate.cpp diff --git a/contrib/src/animate/animate.cpp b/contrib/src/animate/animate.cpp index 5c687f927a..64309fc8a6 100644 --- a/contrib/src/animate/animate.cpp +++ b/contrib/src/animate/animate.cpp @@ -270,7 +270,11 @@ bool wxAnimationPlayer::PlayFrame() PlayFrame(GetCurrentFrame(), * GetWindow(), GetPosition()); // Set the timer for the next frame - m_timer.Start(GetDelay(GetCurrentFrame())); + int delay = GetDelay(GetCurrentFrame()); + if (delay == 0) + delay = 1; // 0 is invalid timeout for wxTimer. + + m_timer.Start(delay); m_currentFrame ++; @@ -572,6 +576,8 @@ bool wxAnimationCtrlBase::Create(wxWindow *parent, wxWindowID id, m_animationPlayer.SetPosition(wxPoint(0, 0)); m_animationPlayer.SetDestroyAnimation(FALSE); + LoadFile(filename); + return TRUE; }