mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
extmod/modframebuf: Save code size in setpixel.
There's a slight code size increase paid for by using setpixel_checked for the last pixel of a line, instead of repeating the checks inline. Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
committed by
Damien George
parent
e15219800e
commit
803da9645f
@@ -483,9 +483,7 @@ static void line(const mp_obj_framebuf_t *fb, mp_int_t x1, mp_int_t y1, mp_int_t
|
|||||||
e += 2 * dy;
|
e += 2 * dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 <= x2 && x2 < fb->width && 0 <= y2 && y2 < fb->height) {
|
setpixel_checked(fb, x2, y2, col, 1);
|
||||||
setpixel(fb, x2, y2, col);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static mp_obj_t framebuf_line(size_t n_args, const mp_obj_t *args_in) {
|
static mp_obj_t framebuf_line(size_t n_args, const mp_obj_t *args_in) {
|
||||||
|
|||||||
Reference in New Issue
Block a user