diff options
Diffstat (limited to 'nuttx/graphics/nxbe')
-rw-r--r-- | nuttx/graphics/nxbe/nxbe.h | 5 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_bitmap.c | 4 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_fill.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_filltrapezoid.c | 4 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_move.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_setposition.c | 11 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_setsize.c | 2 |
7 files changed, 13 insertions, 17 deletions
diff --git a/nuttx/graphics/nxbe/nxbe.h b/nuttx/graphics/nxbe/nxbe.h index e4b3a923d..533303928 100644 --- a/nuttx/graphics/nxbe/nxbe.h +++ b/nuttx/graphics/nxbe/nxbe.h @@ -142,10 +142,11 @@ struct nxbe_window_s FAR struct nxbe_window_s *above; /* The window "above" this window */ FAR struct nxbe_window_s *below; /* The window "below this one */ - /* Window geometry */ + /* Window geometry. The window is described by a rectangle in the + * absolute screen coordinate system (0,0)->(xres,yres) + */ struct nxgl_rect_s bounds; /* The bounding rectangle of window */ - struct nxgl_point_s origin; /* The position of the top-left corner of the window */ /* Client state information this is provide in window callbacks */ diff --git a/nuttx/graphics/nxbe/nxbe_bitmap.c b/nuttx/graphics/nxbe/nxbe_bitmap.c index dbaa1c6b1..293033dc2 100644 --- a/nuttx/graphics/nxbe/nxbe_bitmap.c +++ b/nuttx/graphics/nxbe/nxbe_bitmap.c @@ -137,8 +137,8 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de /* Offset the rectangle and image origin by the window origin */ - nxgl_rectoffset(&bounds, dest, wnd->origin.x, wnd->origin.y); - nxgl_vectoradd(&offset, origin, &wnd->origin); + nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y); + nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1); /* Verify that the destination rectangle begins "below" and to the "right" * of the origin diff --git a/nuttx/graphics/nxbe/nxbe_fill.c b/nuttx/graphics/nxbe/nxbe_fill.c index d175d64fc..fca2445b0 100644 --- a/nuttx/graphics/nxbe/nxbe_fill.c +++ b/nuttx/graphics/nxbe/nxbe_fill.c @@ -125,7 +125,7 @@ void nxbe_fill(FAR struct nxbe_window_s *wnd, * bounding box */ - nxgl_rectoffset(&remaining, rect, wnd->origin.x, wnd->origin.y); + nxgl_rectoffset(&remaining, rect, wnd->bounds.pt1.x, wnd->bounds.pt1.y); /* Clip to the bounding box to the limits of the window and of the * background screen diff --git a/nuttx/graphics/nxbe/nxbe_filltrapezoid.c b/nuttx/graphics/nxbe/nxbe_filltrapezoid.c index d314fec30..f465abbdd 100644 --- a/nuttx/graphics/nxbe/nxbe_filltrapezoid.c +++ b/nuttx/graphics/nxbe/nxbe_filltrapezoid.c @@ -130,7 +130,7 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd, * the framebuffer region */ - nxgl_trapoffset(&info.trap, trap, wnd->origin.x, wnd->origin.y); + nxgl_trapoffset(&info.trap, trap, wnd->bounds.pt1.x, wnd->bounds.pt1.y); /* Create a bounding box that contains the trapezoid */ @@ -144,7 +144,7 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd, if (clip && !nxgl_nullrect(clip)) { struct nxgl_rect_s tmp; - nxgl_rectoffset(&tmp, clip, wnd->origin.x, wnd->origin.y); + nxgl_rectoffset(&tmp, clip, wnd->bounds.pt1.x, wnd->bounds.pt1.y); nxgl_rectintersect(&remaining, &remaining, &tmp); } diff --git a/nuttx/graphics/nxbe/nxbe_move.c b/nuttx/graphics/nxbe/nxbe_move.c index 515c2c215..d0237ec4e 100644 --- a/nuttx/graphics/nxbe/nxbe_move.c +++ b/nuttx/graphics/nxbe/nxbe_move.c @@ -210,7 +210,7 @@ void nxbe_move(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect /* Offset the rectangle by the window origin to create a bounding box */ - nxgl_rectoffset(&info.srcrect, rect, wnd->origin.x, wnd->origin.y); + nxgl_rectoffset(&info.srcrect, rect, wnd->bounds.pt1.x, wnd->bounds.pt1.y); /* Clip to the limits of the window and of the background screen */ diff --git a/nuttx/graphics/nxbe/nxbe_setposition.c b/nuttx/graphics/nxbe/nxbe_setposition.c index bba946fe6..826beb3c8 100644 --- a/nuttx/graphics/nxbe/nxbe_setposition.c +++ b/nuttx/graphics/nxbe/nxbe_setposition.c @@ -93,17 +93,12 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd, /* Back out the old window origin position from the bounding box */ - nxgl_rectoffset(&rect, &wnd->bounds, -wnd->origin.x, -wnd->origin.y); + nxgl_rectoffset(&rect, &wnd->bounds, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); - /* Set the new origin */ - - wnd->origin.x = pos->x; - wnd->origin.y = pos->y; - - /* Add the new window origin back into the bounding box */ + /* Add the new window origin into the bounding box */ nxgl_rectcopy(&before, &wnd->bounds); - nxgl_rectoffset(&wnd->bounds, &rect, wnd->origin.x, wnd->origin.y); + nxgl_rectoffset(&wnd->bounds, &rect, pos->x, pos->y); /* Get the union of the 'before' bounding box and the 'after' bounding * this union is the region of the display that must be updated. diff --git a/nuttx/graphics/nxbe/nxbe_setsize.c b/nuttx/graphics/nxbe/nxbe_setsize.c index 3873807d9..39b6b3f16 100644 --- a/nuttx/graphics/nxbe/nxbe_setsize.c +++ b/nuttx/graphics/nxbe/nxbe_setsize.c @@ -94,7 +94,7 @@ void nxbe_setsize(FAR struct nxbe_window_s *wnd, nxgl_rectcopy(&bounds, &wnd->bounds); - /* Add the window origin to supplied size get the new window bounding box */ + /* Add the window origin to the supplied size get the new window bounding box */ wnd->bounds.pt2.x = wnd->bounds.pt1.x + size->w - 1; wnd->bounds.pt2.y = wnd->bounds.pt1.y + size->h - 1; |