Skip to content

Commit

Permalink
Fix bug introduced in 9096f70
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 27, 2020
1 parent a160dc0 commit 84c4fc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PixelAttributes.cpp
Expand Up @@ -8,8 +8,7 @@
*/

#include "PixelAttributes.h"

using namespace std;
#include <cstring>

PixelAttributes::PixelAttributes():
m_width(0)
Expand All @@ -35,9 +34,10 @@ void PixelAttributes::setWidth(int width)

void PixelAttributes::scroll()
{
*m_pixelAttributes[FirstLine] = *m_pixelAttributes[LastLine];
size_t lineLength = m_width * sizeof(PixelAttribute);
memcpy(m_pixelAttributes[FirstLine], m_pixelAttributes[LastLine], lineLength);
for (size_t i = 1; i < LineCount - 1; ++i) {
*m_pixelAttributes[i] = *m_pixelAttributes[EmptyLine];
memcpy(m_pixelAttributes[i], m_pixelAttributes[EmptyLine], lineLength);
}
}

Expand Down

0 comments on commit 84c4fc4

Please sign in to comment.