Skip to content

Commit f5d0bc0

Browse files
committed
Fix potencial programming error, starting drawing a line at coordinate 0 instead of x or y
1 parent 5feaca4 commit f5d0bc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

native/framebuffers.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ void __APISTATUS_internal pyfb_drawHorizontalLine(uint8_t fbnum,
358358
unsigned long int y,
359359
unsigned long int len,
360360
const struct pyfb_color* color) {
361-
unsigned long int x1 = x + len - 1;
361+
unsigned long int x1 = x + len;
362362

363-
for(unsigned long int ix = 0; ix < len; ix++) {
363+
for(unsigned long int ix = x; ix < x1; ix++) {
364364
pyfb_setPixel(fbnum, ix, y, color);
365365
}
366366
}
@@ -410,9 +410,9 @@ void __APISTATUS_internal pyfb_drawVerticalLine(uint8_t fbnum,
410410
unsigned long int y,
411411
unsigned long int len,
412412
const struct pyfb_color* color) {
413-
unsigned long int y1 = y + len - 1;
413+
unsigned long int y1 = y + len;
414414

415-
for(unsigned int long iy = 0; iy < len; iy++) {
415+
for(unsigned int long iy = y; iy < y1; iy++) {
416416
pyfb_setPixel(fbnum, x, iy, color);
417417
}
418418
}

0 commit comments

Comments
 (0)