fixed bug that listelements were not drawn after scrolling

This commit is contained in:
louis 2016-07-30 15:05:47 +02:00
parent dddb273526
commit 6acc22e5c2
6 changed files with 18 additions and 11 deletions

View File

@ -120,7 +120,10 @@ void cScroller::Init(void) {
}
void cScroller::Reactivate(void) {}
void cScroller::SetInitial(void) {}
void cScroller::SetInitial(void) {
scrollable->SetScrollingStarted();
}
bool cScroller::Pause(void) {
if (!paused)

View File

@ -74,6 +74,7 @@ public:
virtual eScrollMode ScrollMode(void) = 0;
virtual eScrollSpeed ScrollSpeed(void) = 0;
virtual eOrientation ScrollOrientation(void) = 0;
virtual void SetScrollingStarted(void) = 0;
virtual void StartScrolling(void) = 0;
virtual void StopScrolling(void) = 0;
virtual void SetDrawPort(cPoint &point) = 0;

View File

@ -30,6 +30,7 @@ cArea::cArea(void) {
attribs = new cAreaAttribs((int)eAreaAttribs::count);
scrolling = false;
isScrolling = false;
scrollingStarted = false;
scrollFunc = NULL;
blinking = false;
areaContainer = NULL;
@ -45,6 +46,7 @@ cArea::cArea(const cArea &other) {
attribs = new cAreaAttribs(*other.attribs);
//area container is set from outside during cloning of areacontainer
areaContainer = NULL;
scrollingStarted = false;
//scrolling is set from outside by ScrollFunc(), see below
scrolling = other.scrolling;
isScrolling = false;
@ -244,6 +246,7 @@ void cArea::Close(void) {
pix = NULL;
}
init = true;
scrollingStarted = false;
}
void cArea::Clear(bool forceClearBackground) {
@ -255,6 +258,7 @@ void cArea::Clear(bool forceClearBackground) {
pix->SetDrawPortPoint(cPoint(0,0));
pix->Fill(clrTransparent);
}
scrollingStarted = false;
}
void cArea::ClearWithoutIndicators(void) {
@ -265,6 +269,7 @@ void cArea::ClearWithoutIndicators(void) {
if (pix) {
pix->Fill(clrTransparent);
}
scrollingStarted = false;
}
void cArea::Hide(void) {

View File

@ -58,6 +58,7 @@ public:
virtual void SetIndicatorPosition(cPoint &pos) {};
virtual cRect CoveringArea(void) { return cRect::Null; };
virtual bool Scrolling(void) { return false; };
virtual bool ScrollingStarted(void) { return false; };
virtual cArea *ScrollingArea(void) { return NULL; };
virtual cFunction *GetFunction(const char *name) { return NULL; };
virtual const char *Name(void) { return NULL; };
@ -80,6 +81,7 @@ private:
cList<cFunction> functions;
bool scrolling;
bool isScrolling;
bool scrollingStarted;
cFunction *scrollFunc;
list<cBlinker*> blinkers;
bool blinking;
@ -121,6 +123,8 @@ public:
cRect CoveringArea(void);
//Scrollable
bool Scrolling(void);
void SetScrollingStarted(void) { scrollingStarted = true; };
bool ScrollingStarted(void) { return scrollingStarted; };
int ScrollWidth(void);
int ScrollHeight(void);
int ScrollDelay(void);

View File

@ -60,7 +60,7 @@ void cListElement::Clear(bool forceClearBackground) {
void cListElement::WakeCurrent(void) {
if (currentElement) {
currentElement->WakeUp();
}
}
}
void cListElement::Render(void) {
@ -70,16 +70,12 @@ void cListElement::Render(void) {
if (attribs->DoDebug())
Debug();
bool animated = Fading() || Shifting();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
//Check redraw of already scrolling list element
if (drawn && scrollingStarted && node->Scrolling()) {
if (drawn && node->Scrolling() && node->ScrollingStarted()) {
if (DoScroll()) {
//current list element
continue;
} else {
//not current list element anymore
scrollingStarted = false;
}
}
//don't clear animated list element if it was current
@ -97,15 +93,14 @@ void cListElement::Render(void) {
node->Render();
sdOsd->Unlock();
if (DoScroll() && node->Scrolling()) {
if (DoScroll() && node->Scrolling() && !node->ScrollingStarted()) {
cArea *scrollArea = node->ScrollingArea();
if (scrollArea) {
scrollingStarted = true;
cScroller *scroller = new cScroller(scrollArea);
scrollers.push_back(scroller);
cView::AddAnimation(scroller);
}
}
}
}
dirty = false;
drawn = true;

View File

@ -176,7 +176,6 @@
</area>
</scrapercontent>
<channelhints>
<area background="true" x="0" y="{areaheight}*0.75 - {numhints}*{areaheight}*{zapchannelhintsheight}/1000 + 1" width="{zapchannelhintswidth}*{areawidth}/100" height="{numhints}*{areaheight}*{zapchannelhintsheight}/1000" layer="1">
<fill color="{menuback}" />