aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_progressbar.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2016-02-13 11:33:20 +1000
committerinmarket <andrewh@inmarket.com.au>2016-02-13 11:33:20 +1000
commit71d72208b9c7550f104000df4690a5d3cba6caaa (patch)
treee4da91bfdc5cb8858ad9a726fa90335f8c7b3e25 /src/gwin/gwin_progressbar.c
parent23e04c480322709648533e6f79658805b1d43a97 (diff)
downloaduGFX-71d72208b9c7550f104000df4690a5d3cba6caaa.tar.gz
uGFX-71d72208b9c7550f104000df4690a5d3cba6caaa.tar.bz2
uGFX-71d72208b9c7550f104000df4690a5d3cba6caaa.zip
Updates to GWIN slider and progressbar Image draw routines to prevent overwriting.
Diffstat (limited to 'src/gwin/gwin_progressbar.c')
-rw-r--r--src/gwin/gwin_progressbar.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gwin/gwin_progressbar.c b/src/gwin/gwin_progressbar.c
index b1bc917c..d06f8058 100644
--- a/src/gwin/gwin_progressbar.c
+++ b/src/gwin/gwin_progressbar.c
@@ -283,7 +283,7 @@ void gwinProgressbarDraw_Image(GWidgetObject *gw, void *param) {
// Vertical progressbar
if (gw->g.width < gw->g.height) {
if (gsw->dpos != 0) // The unfilled area
- gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gsw->dpos, gw->pstyle->enabled.progress); // Inactive area
+ gdispGFillArea(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gsw->dpos-1, gw->pstyle->enabled.progress); // Inactive area
if (gsw->dpos != gw->g.height-1) { // The filled area
for(z=gw->g.height, v=gi->height; z > gsw->dpos;) {
z -= v;
@@ -291,25 +291,25 @@ void gwinProgressbarDraw_Image(GWidgetObject *gw, void *param) {
v -= gsw->dpos - z;
z = gsw->dpos;
}
- gdispGImageDraw(gw->g.display, gi, gw->g.x, gw->g.y+z, gw->g.width, v, 0, gi->height-v);
+ gdispGImageDraw(gw->g.display, gi, gw->g.x+1, gw->g.y+z+1, gw->g.width-1, v-2, 0, gi->height-v);
}
}
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
- gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gsw->dpos, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos, pcol->edge); // Thumb
+ gdispGDrawLine(gw->g.display, gw->g.x+1, gw->g.y+gsw->dpos, gw->g.x+gw->g.width-2, gw->g.y+gsw->dpos, pcol->edge); // Thumb
// Horizontal progressbar
} else {
if (gsw->dpos != gw->g.width-1) // The unfilled area
- gdispGFillArea(gw->g.display, gw->g.x+gsw->dpos, gw->g.y, gw->g.width-gsw->dpos, gw->g.height, gw->pstyle->enabled.progress); // Inactive area
+ gdispGFillArea(gw->g.display, gw->g.x+gsw->dpos+1, gw->g.y+1, gw->g.width-gsw->dpos-2, gw->g.height-2, gw->pstyle->enabled.progress); // Inactive area
if (gsw->dpos != 0) { // The filled area
for(z=0, v=gi->width; z < gsw->dpos; z += v) {
if (z+v > gsw->dpos)
v -= z+v - gsw->dpos;
- gdispGImageDraw(gw->g.display, gi, gw->g.x+z, gw->g.y, v, gw->g.height, 0, 0);
+ gdispGImageDraw(gw->g.display, gi, gw->g.x+z+1, gw->g.y+1, v-1, gw->g.height-2, 0, 0);
}
}
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
- gdispGDrawLine(gw->g.display, gw->g.x+gsw->dpos, gw->g.y, gw->g.x+gsw->dpos, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
+ gdispGDrawLine(gw->g.display, gw->g.x+gsw->dpos, gw->g.y+1, gw->g.x+gsw->dpos, gw->g.y+gw->g.height-2, pcol->edge); // Thumb
}
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);