Several changes (mostly graphics related) from Petteri Aimonen

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5385 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-11-23 15:49:06 +00:00
parent 92469824e6
commit 9ff9979b2b
6 changed files with 27 additions and 10 deletions
+5 -2
View File
@@ -41,6 +41,7 @@
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <nuttx/nx/nxglib.h>
@@ -192,9 +193,11 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector,
/* The final degenerate case */
if (linewidth == 1)
if (linewidth == 1 &&
abs(line.pt2.x - line.pt1.x) < (line.pt2.y - line.pt1.y))
{
/* A line of width 1 is basically a single parallelogram of width 1 */
/* A close to vertical line of width 1 is basically
* a single parallelogram of width 1 */
traps[1].top.x1 = itob16(line.pt1.x);
traps[1].top.x2 = traps[1].top.x1;
+9 -2
View File
@@ -94,6 +94,7 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
{
FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd;
struct nxgl_rect_s relclip;
struct nxgl_trapezoid_s reltrap;
#ifdef CONFIG_DEBUG
if (!hfwnd || !trap || !color)
@@ -103,8 +104,14 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
}
#endif
/* Perform the fill, clipping to the client window */
/* Move the trapezoid from window contents area to window area */
nxgl_trapoffset(&reltrap, trap,
fwnd->fwrect.pt1.x - fwnd->wnd.bounds.pt1.x,
fwnd->fwrect.pt1.y - fwnd->wnd.bounds.pt1.y);
/* Perform the fill, clipping to the client window */
nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, trap, color);
return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, &reltrap, color);
}