forked from PX4/NuttX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graphics/nxconsole/nxcon_scroll.c: Fix scrolling in the NxConsole for…
… the case of the framebuffer device. In this case, the logic for clearing the vacated region at the bottom was missing so garbage up from the last, uncleared line
- Loading branch information
1 parent
ee3ea73
commit 75177c1
Showing
1 changed file
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**************************************************************************** | ||
* nuttx/graphics/nxconsole/nxcon_scroll.c | ||
* | ||
* Copyright (C) 2012 Gregory Nutt. All rights reserved. | ||
* Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. | ||
* Author: Gregory Nutt <[email protected]> | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -118,7 +118,7 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv, | |
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); | ||
if (ret < 0) | ||
{ | ||
gdbg("fill failed: %d\n", errno); | ||
gdbg("Fill failed: %d\n", errno); | ||
} | ||
|
||
/* Fill each character that might lie within in the bounding box */ | ||
|
@@ -133,15 +133,15 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv, | |
} | ||
} | ||
|
||
/* Finally, clear the bottom part of the display */ | ||
/* Finally, clear the vacated part of the display */ | ||
|
||
rect.pt1.y = bottom; | ||
rect.pt2.y = priv->wndo.wsize.h- 1; | ||
|
||
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); | ||
if (ret < 0) | ||
{ | ||
gdbg("nxcon_movedisplay: fill failed: %d\n", errno); | ||
gdbg("Fill failed: %d\n", errno); | ||
} | ||
} | ||
#else | ||
|
@@ -152,14 +152,18 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv, | |
struct nxgl_point_s offset; | ||
int ret; | ||
|
||
/* Add the line separation value to the scroll height */ | ||
|
||
scrollheight += CONFIG_NXCONSOLE_LINESEPARATION; | ||
|
||
/* Move the display in the range of 0-height up one scrollheight. The | ||
* line at the bottom will be reset to the background color automatically. | ||
* | ||
* The source rectangle to be moved. | ||
*/ | ||
|
||
rect.pt1.x = 0; | ||
rect.pt1.y = scrollheight + CONFIG_NXCONSOLE_LINESEPARATION; | ||
rect.pt1.y = scrollheight; | ||
rect.pt2.x = priv->wndo.wsize.w - 1; | ||
rect.pt2.y = priv->wndo.wsize.h - 1; | ||
|
||
|
@@ -168,12 +172,22 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv, | |
offset.x = 0; | ||
offset.y = -scrollheight; | ||
|
||
/* Move the source rectangle */ | ||
/* Move the source rectangle upward by the scrollheight */ | ||
|
||
ret = priv->ops->move(priv, &rect, &offset); | ||
if (ret < 0) | ||
{ | ||
gdbg("move failed: %d\n", errno); | ||
gdbg("Move failed: %d\n", errno); | ||
} | ||
|
||
/* Finally, clear the vacated bottom part of the display */ | ||
|
||
rect.pt1.y = priv->wndo.wsize.h - scrollheight; | ||
|
||
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); | ||
if (ret < 0) | ||
{ | ||
gdbg("Fill failed: %d\n", errno); | ||
} | ||
} | ||
#endif | ||
|