Fix a few NXTEXT bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3765 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
ed975abb65
commit
29ef946bee
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* graphics/nxbe/nxbe_move.c
|
* graphics/nxbe/nxbe_move.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -198,7 +198,6 @@ static void nxbe_clipmovedest(FAR struct nxbe_clipops_s *cops,
|
||||||
void nxbe_move(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect,
|
void nxbe_move(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect,
|
||||||
FAR const struct nxgl_point_s *offset)
|
FAR const struct nxgl_point_s *offset)
|
||||||
{
|
{
|
||||||
FAR const struct nxgl_rect_s *bounds = &wnd->bounds;
|
|
||||||
struct nxbe_move_s info;
|
struct nxbe_move_s info;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -229,30 +228,46 @@ void nxbe_move(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect
|
||||||
info.offset.y = offset->y;
|
info.offset.y = offset->y;
|
||||||
info.wnd = wnd;
|
info.wnd = wnd;
|
||||||
|
|
||||||
|
/* The clip order depends up the direction that the rectangle is being
|
||||||
|
* moved.
|
||||||
|
*/
|
||||||
|
|
||||||
if (offset->y < 0)
|
if (offset->y < 0)
|
||||||
{
|
{
|
||||||
|
/* Moving rectangle up */
|
||||||
|
|
||||||
if (offset->x < 0)
|
if (offset->x < 0)
|
||||||
{
|
{
|
||||||
|
/* Moving to upper-left */
|
||||||
|
|
||||||
info.order = NX_CLIPORDER_TLRB; /* Top-left-right-bottom */
|
info.order = NX_CLIPORDER_TLRB; /* Top-left-right-bottom */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Moving to upper-right (or just up) */
|
||||||
|
|
||||||
info.order = NX_CLIPORDER_TRLB; /* Top-right-left-bottom */
|
info.order = NX_CLIPORDER_TRLB; /* Top-right-left-bottom */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Moving rectangle down (or just left/right) */
|
||||||
|
|
||||||
if (offset->x < 0)
|
if (offset->x < 0)
|
||||||
{
|
{
|
||||||
|
/* Moving to lower-left */
|
||||||
|
|
||||||
info.order = NX_CLIPORDER_BLRT; /* Bottom-left-right-top */
|
info.order = NX_CLIPORDER_BLRT; /* Bottom-left-right-top */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Moving to lower-right */
|
||||||
|
|
||||||
info.order = NX_CLIPORDER_BRLT; /* Bottom-right-left-top */
|
info.order = NX_CLIPORDER_BRLT; /* Bottom-right-left-top */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nxgl_rectintersect(&info.srcrect, bounds, &wnd->be->bkgd.bounds);
|
/* Then perform the move */
|
||||||
|
|
||||||
#if CONFIG_NX_NPLANES > 1
|
#if CONFIG_NX_NPLANES > 1
|
||||||
for (i = 0; i < wnd->be->vinfo.nplanes; i++)
|
for (i = 0; i < wnd->be->vinfo.nplanes; i++)
|
||||||
|
|
Loading…
Reference in New Issue