aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2013-03-18 18:27:52 +1000
committerAndrew Hannam <andrewh@inmarket.com.au>2013-03-18 18:27:52 +1000
commitcc5729dedd3dc84043703b22b498dcb0f2729f5b (patch)
treed3398e5f90b05bfd4d320cda7c1ae8d46c256a2d /src/gdisp
parente7b54696f6e406c892307302a0bd442aa11e2bfa (diff)
downloaduGFX-cc5729dedd3dc84043703b22b498dcb0f2729f5b.tar.gz
uGFX-cc5729dedd3dc84043703b22b498dcb0f2729f5b.tar.bz2
uGFX-cc5729dedd3dc84043703b22b498dcb0f2729f5b.zip
Change GDISP poly fns to support translation
Change GDISP poly fns to support translation - required for adding poly functions to GWIN
Diffstat (limited to 'src/gdisp')
-rw-r--r--src/gdisp/gdisp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index f18bb66f..d548eae5 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -566,16 +566,16 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
}
#if GDISP_NEED_CONVEX_POLYGON
- void gdispDrawPoly(const point *pntarray, unsigned cnt, color_t color) {
+ void gdispDrawPoly(coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color) {
const point *epnt, *p;
epnt = &pntarray[cnt-1];
for(p = pntarray; p < epnt; p++)
- gdispDrawLine(p->x, p->y, p[1].x, p[1].y, color);
- gdispDrawLine(p->x, p->y, pntarray->x, pntarray->y, color);
+ gdispDrawLine(tx+p->x, ty+p->y, tx+p[1].x, ty+p[1].y, color);
+ gdispDrawLine(tx+p->x, ty+p->y, tx+pntarray->x, ty+pntarray->y, color);
}
- void gdispFillConvexPoly(const point *pntarray, unsigned cnt, color_t color) {
+ void gdispFillConvexPoly(coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color) {
const point *lpnt, *rpnt, *epnts;
fpcoord_t lx, rx, lk, rk;
coord_t y, ymax, lxc, rxc;
@@ -622,14 +622,14 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
*/
if (lxc < rxc) {
if (rxc - lxc == 1)
- gdispDrawPixel(lxc, y, color);
+ gdispDrawPixel(tx+lxc, ty+y, color);
else
- gdispDrawLine(lxc, y, rxc-1, y, color);
+ gdispDrawLine(tx+lxc, ty+y, tx+rxc-1, ty+y, color);
} else if (lxc > rxc) {
if (lxc - rxc == 1)
- gdispDrawPixel(rxc, y, color);
+ gdispDrawPixel(tx+rxc, ty+y, color);
else
- gdispDrawLine(rxc, y, lxc-1, y, color);
+ gdispDrawLine(tx+rxc, ty+y, tx+lxc-1, ty+y, color);
}
lx += lk;