summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-10 18:54:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-10 18:54:54 +0000
commit33d6714215d70933d95c82a8396ceafde0c20ffe (patch)
tree3ed06182fbddb2cb7bb9faee058e2eb814c2fb48
parent4b40e8314b015f07618e88b7c5e7c00b55679a82 (diff)
downloadpx4-nuttx-33d6714215d70933d95c82a8396ceafde0c20ffe.tar.gz
px4-nuttx-33d6714215d70933d95c82a8396ceafde0c20ffe.tar.bz2
px4-nuttx-33d6714215d70933d95c82a8396ceafde0c20ffe.zip
Fix an error in the NX move logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3766 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--apps/examples/nxtext/nxtext_bkgd.c6
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/Documentation/NXGraphicsSubsystem.html4
-rw-r--r--nuttx/graphics/nxbe/nxbe_move.c10
4 files changed, 17 insertions, 7 deletions
diff --git a/apps/examples/nxtext/nxtext_bkgd.c b/apps/examples/nxtext/nxtext_bkgd.c
index 6bc7a82cf..a2feefd24 100644
--- a/apps/examples/nxtext/nxtext_bkgd.c
+++ b/apps/examples/nxtext/nxtext_bkgd.c
@@ -252,6 +252,8 @@ static inline void nxbg_scroll(NXWINDOW hwnd, int lineheight)
/* Move the display in the range of 0-height up one lineheight. The
* line at the bottom will be reset to the background color automatically.
+ *
+ * The source rectangle to be moved.
*/
rect.pt1.x = 0;
@@ -259,9 +261,13 @@ static inline void nxbg_scroll(NXWINDOW hwnd, int lineheight)
rect.pt2.x = g_bgstate.wsize.w - 1;
rect.pt2.y = g_bgstate.wsize.h - 1;
+ /* The offset that determines how far to move the source rectangle */
+
offset.x = 0;
offset.y = -lineheight;
+ /* Move the source rectangle */
+
ret = nx_move(hwnd, &rect, &offset);
if (ret < 0)
{
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index a552284f1..a933a0503 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -1889,4 +1889,6 @@
(also submitted by Hal Glenn).
* graphics/nxfonts/nxfonts_convert.c: Fixed a critical bug that caused
when renderer some fonts with bits-per-pixel > 8
-
+ * graphics/nxbe/nxbe_move.c: Fixed an error in the graphics move logic (This
+ was a previously untested interface). Basically, there is some confusion
+ between use of (x,y) as a relative offset or as an absolute position.
diff --git a/nuttx/Documentation/NXGraphicsSubsystem.html b/nuttx/Documentation/NXGraphicsSubsystem.html
index d55d6e449..e37c3b9cf 100644
--- a/nuttx/Documentation/NXGraphicsSubsystem.html
+++ b/nuttx/Documentation/NXGraphicsSubsystem.html
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NX Graphics Subsystem</i>
</font></big></h1>
- <p>Last Updated: March 20, 2010</p>
+ <p>Last Updated: July 10, 2011</p>
</td>
</tr>
</table>
@@ -3014,7 +3014,7 @@ make
<td align="left" valign="top"><a href="#nxmove"><code>nx_move()</code></a></td>
<td>Change to <code>CONFIG_EXAMPLES_NX_RAWWINDOWS=y</code> in the
<code>&lt;NuttX-Directory&gt;/.config</code> file</td>
- <td align="center" bgcolor="lightgrey">NO</td>
+ <td align="center" bgcolor="skyblue">YES</td>
</tr>
<tr>
<td align="left" valign="top"><a href="#nxbitmap"><code>nx_bitmap()</code></a></td>
diff --git a/nuttx/graphics/nxbe/nxbe_move.c b/nuttx/graphics/nxbe/nxbe_move.c
index d5bbe8403..b5c5cc6b7 100644
--- a/nuttx/graphics/nxbe/nxbe_move.c
+++ b/nuttx/graphics/nxbe/nxbe_move.c
@@ -89,12 +89,14 @@ static void nxbe_clipmovesrc(FAR struct nxbe_clipops_s *cops,
FAR const struct nxgl_rect_s *rect)
{
struct nxbe_move_s *info = (struct nxbe_move_s *)cops;
+ struct nxgl_point_s offset;
if (info->offset.x != 0 || info->offset.y != 0)
{
- struct nxgl_rect_s dest;
- nxgl_rectoffset(&dest, rect, info->offset.x, info->offset.y);
- plane->moverectangle(&plane->pinfo, &dest, &info->offset);
+ offset.x = rect->pt1.x + info->offset.x;
+ offset.y = rect->pt1.y + info->offset.y;
+
+ plane->moverectangle(&plane->pinfo, rect, &offset);
}
}
@@ -156,7 +158,7 @@ static void nxbe_clipmovedest(FAR struct nxbe_clipops_s *cops,
}
}
- /* Cip to determine what is inside the bounds */
+ /* Clip to determine what is inside the bounds */
nxgl_rectoffset(&tmprect1, rect, -offset.x, -offset.y);
nxgl_rectintersect(&src, &tmprect1, &dstdata->srcrect);