Fixing bug in gdispGFillConvexPoly

This commit is contained in:
Corentin Barman 2016-11-09 19:22:06 +01:00
parent 7f4bfaadd5
commit ff65d4f220

View File

@ -2950,6 +2950,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
/* Replace the appropriate point */ /* Replace the appropriate point */
if (ymax == lpnt->y) { if (ymax == lpnt->y) {
lx -= FIXED0_5;
for (lpnt = lpnt <= pntarray ? epnts : lpnt-1; lpnt->y == y; cnt--) { for (lpnt = lpnt <= pntarray ? epnts : lpnt-1; lpnt->y == y; cnt--) {
if (!cnt) { if (!cnt) {
autoflush(g); autoflush(g);
@ -2962,6 +2963,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
lk = (FIXED(lpnt->x) - lx) / (lpnt->y - y); lk = (FIXED(lpnt->x) - lx) / (lpnt->y - y);
lx += FIXED0_5; lx += FIXED0_5;
} else { } else {
rx -= FIXED0_5;
for (rpnt = rpnt >= epnts ? pntarray : rpnt+1; rpnt->y == y; cnt--) { for (rpnt = rpnt >= epnts ? pntarray : rpnt+1; rpnt->y == y; cnt--) {
if (!cnt) { if (!cnt) {
autoflush(g); autoflush(g);