summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflat@schirrmacher.eu>2013-08-02 19:15:20 +0200
committerMartin Schirrmacher <vdr.skinflat@schirrmacher.eu>2013-08-02 19:15:20 +0200
commit67003cbe4786962638225ca9632a8855574d602b (patch)
tree4e6e21f063d2226238c3c38f3c7a42a6d0960b31
parentd596cd9c45dbd4e7635147094d3f35a7df892183 (diff)
downloadskin-flat-67003cbe4786962638225ca9632a8855574d602b.tar.gz
skin-flat-67003cbe4786962638225ca9632a8855574d602b.tar.bz2
fix replay mark progress
-rw-r--r--baserender.c48
-rw-r--r--baserender.h2
2 files changed, 31 insertions, 19 deletions
diff --git a/baserender.c b/baserender.c
index 1905076..f59c5dc 100644
--- a/baserender.c
+++ b/baserender.c
@@ -311,8 +311,8 @@ int cFlatBaseRender::ProgressBarHeight(void) {
void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent) {
progressBarColorMark = Color;
progressBarColorMarkCurrent = ColorCurrent;
- int posLast = 0;
- int posCurrent = 0;
+ int posMark = 0, posMarkLast = 0;
+ int posCurrent;
int top = progressBarHeight / 2 - 3;
progressBarPixmap->Fill( progressBarColorBg );
@@ -321,12 +321,18 @@ void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks
if( Marks ) {
bool Start = true;
for( const cMark *m = Marks->First(); m; m = Marks->Next(m) ) {
- posCurrent = ProgressBarMarkPos( m->Position(), Total );
- ProgressBarDrawMark(posCurrent, posLast, Start, m->Position() == Current);
- posLast = posCurrent;
+ posMark = ProgressBarMarkPos( m->Position(), Total );
+ posCurrent = ProgressBarMarkPos( Current, Total );
+
+ ProgressBarDrawMark(posMark, posMarkLast, posCurrent, Start, m->Position() == Current);
+ posMarkLast = posMark;
Start = !Start;
}
- progressBarPixmap->DrawRectangle(cRect( posLast, top, progressBarWidth - posLast, 6), progressBarColorBarFg);
+ if( !Start ) {
+ progressBarPixmap->DrawRectangle(cRect( posMarkLast, top, progressBarWidth - posMarkLast, 6), progressBarColorBarFg);
+ if( posCurrent > posMarkLast )
+ progressBarPixmap->DrawRectangle(cRect( posMarkLast, top, posCurrent - posMarkLast, 6), progressBarColorMarkCurrent);
+ }
} else {
ProgressBarDraw(Current, Total);
}
@@ -336,26 +342,32 @@ int cFlatBaseRender::ProgressBarMarkPos(int P, int Total) {
return P * progressBarWidth / Total;
}
-void cFlatBaseRender::ProgressBarDrawMark(int X1, int X0, bool Start, bool Current)
+void cFlatBaseRender::ProgressBarDrawMark(int posMark, int posMarkLast, int posCurrent, bool Start, bool isCurrent)
{
int top = progressBarHeight / 2 - 3;
if( Start ) {
- if( Current )
- progressBarPixmap->DrawRectangle(cRect( X1-5, 0, 10, 3), progressBarColorMarkCurrent);
+ if( isCurrent )
+ progressBarPixmap->DrawRectangle(cRect( posMark-5, 0, 10, 3), progressBarColorMarkCurrent);
else
- progressBarPixmap->DrawRectangle(cRect( X1-3, 0, 6, 3), progressBarColorMark);
+ progressBarPixmap->DrawRectangle(cRect( posMark-3, 0, 6, 3), progressBarColorMark);
} else {
- if( Current )
- progressBarPixmap->DrawRectangle(cRect( X1-5, progressBarHeight - 3, 10, 3), progressBarColorMarkCurrent);
+ if( isCurrent )
+ progressBarPixmap->DrawRectangle(cRect( posMark-5, progressBarHeight - 3, 10, 3), progressBarColorMarkCurrent);
else
- progressBarPixmap->DrawRectangle(cRect( X1-3, progressBarHeight - 3, 6, 3), progressBarColorMark);
-
- progressBarPixmap->DrawRectangle(cRect( X0, top, X1 - X0, 6), progressBarColorBarFg);
+ progressBarPixmap->DrawRectangle(cRect( posMark-3, progressBarHeight - 3, 6, 3), progressBarColorMark);
+
+ if( posCurrent > posMark )
+ progressBarPixmap->DrawRectangle(cRect( posMarkLast, top, posMark - posMarkLast, 6), progressBarColorMarkCurrent);
+ else {
+ progressBarPixmap->DrawRectangle(cRect( posMarkLast, top, posMark - posMarkLast, 6), progressBarColorBarFg);
+ if( posCurrent > posMarkLast )
+ progressBarPixmap->DrawRectangle(cRect( posMarkLast, top, posCurrent - posMarkLast, 6), progressBarColorMarkCurrent);
+ }
}
- if( Current )
- progressBarPixmap->DrawRectangle(cRect( X1-1, 0, 2, progressBarHeight), progressBarColorMarkCurrent);
+ if( isCurrent )
+ progressBarPixmap->DrawRectangle(cRect( posMark-1, 0, 2, progressBarHeight), progressBarColorMarkCurrent);
else
- progressBarPixmap->DrawRectangle(cRect( X1-1, 0, 2, progressBarHeight), progressBarColorMark);
+ progressBarPixmap->DrawRectangle(cRect( posMark-1, 0, 2, progressBarHeight), progressBarColorMark);
}
diff --git a/baserender.h b/baserender.h
index fe6a9c4..4033545 100644
--- a/baserender.h
+++ b/baserender.h
@@ -52,7 +52,7 @@ class cFlatBaseRender
void contentDraw(void);
double ScrollbarSize(void);
- void ProgressBarDrawMark(int X1, int X0, bool Start, bool Current);
+ void ProgressBarDrawMark(int posMark, int posMarkLast, int posCurrent, bool Start, bool isCurrent);
int ProgressBarMarkPos(int P, int Total);
public: