mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Completes test of line/trapezoid drawing routines
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3842 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user