diff options
Diffstat (limited to 'nuttx/graphics')
-rw-r--r-- | nuttx/graphics/nxglib/fb/nxglib_filltrapezoid.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxglib/lcd/nxglib_filltrapezoid.c | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/nuttx/graphics/nxglib/fb/nxglib_filltrapezoid.c b/nuttx/graphics/nxglib/fb/nxglib_filltrapezoid.c index 4f0c2f072..ddaa0f9bf 100644 --- a/nuttx/graphics/nxglib/fb/nxglib_filltrapezoid.c +++ b/nuttx/graphics/nxglib/fb/nxglib_filltrapezoid.c @@ -201,7 +201,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)( * always draw at least one pixel. */ - if (x1 > x2 || ix2 < bounds->pt1.x || ix1 > bounds->pt2.x) + if (x1 <= x2 && ix2 >= bounds->pt1.x && ix1 <= bounds->pt2.x) { /* Get a clipped copies of the starting and ending X positions. This * clipped truncates "down" and gives the quantized pixel holding the diff --git a/nuttx/graphics/nxglib/lcd/nxglib_filltrapezoid.c b/nuttx/graphics/nxglib/lcd/nxglib_filltrapezoid.c index faeebbec7..0653da413 100644 --- a/nuttx/graphics/nxglib/lcd/nxglib_filltrapezoid.c +++ b/nuttx/graphics/nxglib/lcd/nxglib_filltrapezoid.c @@ -93,7 +93,6 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX) NXGL_PIXEL_T color) { unsigned int ncols; - unsigned int dy; unsigned int topy; unsigned int boty; unsigned int row; @@ -104,6 +103,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX) b16_t botx2; b16_t dx1dy; b16_t dx2dy; + int dy; int ix1; int ix2; @@ -174,13 +174,6 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX) boty = bounds->pt2.y; } - /* Break out now if it was completely clipped */ - - if (topy > boty) - { - return; - } - /* Handle the special case where the sides cross (as in an hourglass) */ if (botx1 > botx2) |