Skip to content

Commit

Permalink
Merge pull request #24 from dipsywong98/fix/overlay-bug
Browse files Browse the repository at this point in the history
Fix/overlay bug
  • Loading branch information
dipsywong98 authored Feb 28, 2019
2 parents 0078e39 + 2d9d031 commit 183abfc
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 133 deletions.
2 changes: 1 addition & 1 deletion ImpressionistDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void ImpressionistDoc::swapContent()
m_ucPainting = m_ucBitmap;
m_ucBitmap = temp;
m_ucOriginal = temp;
memcpy(m_ucBackup, m_ucPainting, m_nWidth*m_nHeight * 3);
//memcpy(m_ucBackup, m_ucPainting, m_nWidth*m_nHeight * 3);
m_pUI->m_origView->refresh();
m_pUI->m_paintView->refresh();
}
Expand Down
1 change: 1 addition & 0 deletions ImpressionistDoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ImpressionistDoc

unsigned char* m_ucHistory; //for undo
unsigned char* m_ucAnother; //for another image
unsigned char *m_ucBackup = NULL;
int m_alphaMapWidth;
int m_alphaMapHeight;

Expand Down
6 changes: 3 additions & 3 deletions LineBrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ void LineBrush::BrushEnd(const Point source, const Point target)

void LineBrush::RightBegin(const Point source, const Point target)
{
start = source;
start = target;
}

void LineBrush::RightMove(const Point source, const Point target)
{
glColor3f(1, 0, 0);
glBegin(GL_LINES);
glVertex2d(start.x, start.y);
glVertex2d(source.x, source.y);
glVertex2d(target.x, target.y);
glEnd();
}

void LineBrush::RightEnd(const Point source, const Point target)
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg = pDoc->m_pUI;
int angle = static_cast<int>(radToDeg(atan2(source.y - start.y, source.x - start.x)));
int angle = static_cast<int>(radToDeg(atan2(target.y - start.y, target.x - start.x)));
dlg->setLineAngle(angle);
}

Expand Down
Loading

0 comments on commit 183abfc

Please sign in to comment.