Fix a positioning problem in CRlePaletteBitmap
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4694 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
6a69813e35
commit
c7868d0bbf
@ -20,3 +20,5 @@
|
|||||||
out in the 1.0 release but is verfied functional in 1.1.
|
out in the 1.0 release but is verfied functional in 1.1.
|
||||||
* CRlePalettBitmap: Fix an error in the text that determines if we
|
* CRlePalettBitmap: Fix an error in the text that determines if we
|
||||||
need to "rewind" to the beginning of the image.
|
need to "rewind" to the beginning of the image.
|
||||||
|
* CRlePalettBitmap: Fixe a positioning problem. It was actually losing
|
||||||
|
the last row of every image!
|
||||||
|
@ -274,7 +274,7 @@ int MAIN_NAME(int argc, char *argv[])
|
|||||||
delete g_nxwmtest.taskbar;
|
delete g_nxwmtest.taskbar;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
showTestCaseMemory("After initializing memory menager");
|
showTestCaseMemory("After initializing window manager");
|
||||||
|
|
||||||
// Create the start window. The general sequence for setting up the start window is:
|
// Create the start window. The general sequence for setting up the start window is:
|
||||||
//
|
//
|
||||||
|
@ -242,12 +242,22 @@ void CRlePaletteBitmap::startOfImage(void)
|
|||||||
|
|
||||||
bool CRlePaletteBitmap::advancePosition(nxgl_coord_t npixels)
|
bool CRlePaletteBitmap::advancePosition(nxgl_coord_t npixels)
|
||||||
{
|
{
|
||||||
|
// Advance to the next column after consuming 'npixels' on this colum
|
||||||
int newcol = m_col + npixels;
|
int newcol = m_col + npixels;
|
||||||
|
|
||||||
|
// Have we consumed the entire row?
|
||||||
|
|
||||||
while (newcol >= m_bitmap->width)
|
while (newcol >= m_bitmap->width)
|
||||||
{
|
{
|
||||||
|
// Advance to the next row
|
||||||
|
|
||||||
newcol -= m_bitmap->width;
|
newcol -= m_bitmap->width;
|
||||||
if (++m_row >= m_bitmap->height)
|
m_row++;
|
||||||
|
|
||||||
|
// If we still have pixels to account for but we have exceeded the
|
||||||
|
// the size of the bitmap, then return false
|
||||||
|
|
||||||
|
if (newcol > 0 && m_row >= m_bitmap->height)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user