The "small optimization" causes asserts if Play is called before the

first EVT_SIZE event (because the m_backingStore bitmap won't have
been created yet) so take it out.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2006-11-07 05:12:52 +00:00
parent 05d46ba223
commit 8434297daf

View File

@ -373,15 +373,11 @@ bool wxAnimationCtrl::Play(bool looped)
if (!m_animation.IsOk()) if (!m_animation.IsOk())
return false; return false;
int oldframe = m_currentFrame;
m_looped = looped; m_looped = looped;
m_currentFrame = 0; m_currentFrame = 0;
// small optimization: if the back store was already updated to the if (!RebuildBackingStoreUpToFrame(0))
// first frame, don't rebuild it return false;
if (oldframe != 0)
if (!RebuildBackingStoreUpToFrame(0))
return false;
m_isPlaying = true; m_isPlaying = true;