fixed ending of animations

This commit is contained in:
louis 2016-05-27 12:13:39 +02:00
parent aa8370363a
commit ed8273883e
3 changed files with 14 additions and 13 deletions

View File

@ -224,11 +224,11 @@ void cAnimation::Detach(void) {
if (delay > 0) if (delay > 0)
Sleep(delay); Sleep(delay);
} }
if (!Running()) return; //if (!Running()) return;
detachable->ParseDetached(); detachable->ParseDetached();
if (!Running()) return; //if (!Running()) return;
detachable->RenderDetached(); detachable->RenderDetached();
if (!Running()) return; //if (!Running()) return;
if (!doAnimation) if (!doAnimation)
detachable->Flush(false); detachable->Flush(false);
if (!Running()) return; if (!Running()) return;

View File

@ -299,10 +299,7 @@ void cViewElement::Clear(bool forceClearBackground) {
} }
void cViewElement::Hide(void) { void cViewElement::Hide(void) {
delete shifter; StopAnimation();
shifter = NULL;
delete fader;
fader = NULL;
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) { for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
sdOsd->Lock(); sdOsd->Lock();
node->Hide(); node->Hide();
@ -328,12 +325,7 @@ void cViewElement::WakeUp(void) {
} }
void cViewElement::Close(void) { void cViewElement::Close(void) {
delete detacher; StopAnimation();
detacher = NULL;
delete fader;
fader = NULL;
delete shifter;
shifter = NULL;
StopScrolling(); StopScrolling();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) { for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->StopBlinkers(); node->StopBlinkers();
@ -581,3 +573,11 @@ cPoint cViewElement::ShiftStart(cRect &shiftbox) {
return start; return start;
} }
void cViewElement::StopAnimation(void) {
delete detacher;
detacher = NULL;
delete shifter;
shifter = NULL;
delete fader;
fader = NULL;
}

View File

@ -43,6 +43,7 @@ protected:
void InheritTokenContainerDeep(void); void InheritTokenContainerDeep(void);
virtual bool DoScroll(void) { return true; }; virtual bool DoScroll(void) { return true; };
cPoint ShiftStart(cRect &shiftbox); cPoint ShiftStart(cRect &shiftbox);
void StopAnimation(void);
public: public:
cViewElement(void); cViewElement(void);
cViewElement(const cViewElement &other); cViewElement(const cViewElement &other);