aboutsummaryrefslogtreecommitdiff
path: root/extmod/modframebuf.c
diff options
context:
space:
mode:
authorOleg Korsak <kamikaze.is.waiting.you@gmail.com>2017-01-07 22:03:51 +0200
committerOleg Korsak <kamikaze.is.waiting.you@gmail.com>2017-01-08 20:16:17 +0200
commite45035db5c297190eee18cefa3b91b36b9f0e32b (patch)
treec77aff72bd188f2a79955d0b0596903f28ba8b4c /extmod/modframebuf.c
parent65cadbeb9d78bfc80314ff4f19fdb4aff5e78244 (diff)
extmod/modframebuf: optimize fill_rect subroutine call
Diffstat (limited to 'extmod/modframebuf.c')
-rw-r--r--extmod/modframebuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c
index d6e686e07..93d4922c9 100644
--- a/extmod/modframebuf.c
+++ b/extmod/modframebuf.c
@@ -115,7 +115,7 @@ static inline uint32_t getpixel(const mp_obj_framebuf_t *fb, int x, int y) {
}
STATIC void fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int h, uint32_t col) {
- if (x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) {
+ if (h < 1 || w < 1 || x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) {
// No operation needed.
return;
}